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 ==
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="
Program HelloWorld
Line 35:
</source>
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="
Record CustomerRecord type BasicRecord
customerNumber INT;
Line 67:
* In this example, the record '''''Employee''''' is bound to a table (or view) named '''''Employee'''''.
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="
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.
The main component of a Rich UI application is a Rich UI handler part. These parts are generated into JavaScript.
|