EGL (programming language): Difference between revisions

Content deleted Content added
m Replace magic links with templates per local RfC and MediaWiki RfC
m Code examples: split subsections
Line 14:
== 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. Program functions are composed of a set of EGL statements, variables, and constants.
 
<source lang="textpascal" line highlight="5">
Program HelloWorld
 
Line 35:
</source>
 
'''=== Record''' ===
 
An EGL Record part defines a set of data elements. In this example, a record with the name '''''CustomerRecord''''' is defined with 6 fields.
 
<source lang="textpascal">
Record CustomerRecord type BasicRecord
customerNumber INT;
Line 67:
* 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="javascriptpascal" line highlight="1,5,11">
package com.mycompany.services;
 
Line 98:
* 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''' ===
 
The main component of a Rich UI application is a Rich UI handler part. These parts are generated into JavaScript.