Content deleted Content added
No edit summary |
No edit summary |
||
Line 8:
== Code examples ==
'''Program'''
An EGL Program part is a generatable logic part with one entry point. Each Program part contains a main() function, which represents the logic that runs at program start up. A program can include other functions and can access functions that are outside of the program. The function main() can invoke those other functions. Programs functions are composed of a set of EGL statements, variables, and constants.
<source lang="java">
Program HelloWorld
const GREETING string = "Hello, ";
function main()
myName string = "John";
sayHello(myName);
end
function sayHello(name String in)
SysLib.writeStdOut(GREETING + name + "!");
end
end
</source>
'''Record'''
Line 24 ⟶ 45:
</source>
EGL has a specialized type of record called '''''SQLRecord''''' that is used to exchange data with a relational database
<source lang="java">
Line 40 ⟶ 61:
</source>
* In this example, the record '''''Employee''''' is bound to a table (or view) named '''''Employee'''''.
'''Service'''
An EGL Service part contains public functions meant to be accessed from other applications or systems. In this example, a service with two functions is defined
<source lang="java">
Line 67 ⟶ 90:
end
</source>
* In EGL, code is organized in packages (like [[Java (programming language)]])
* The first function, ''getEmployees'', returns an array of records populated from the records in a database.
* The second function, ''addEmployee'' adds a new record to the database and returns a true or false depending on whether the record was added successfully.
'''RUIHandler'''
== Web 2.0 with EGL ==
|