Parts
- Data parts contain values.
- Logic parts perform operations on data.
- User Interface (UI) parts provide specialized data structures for interaction with a user.
Main parts such as FormGroups, Libraries, and Programs have the same name as the source file. You can create source files that have no main parts at all; for example, to store some kinds of data parts.
A variable is a named entity in either an EGL logic part or Record. Variables are based on data parts, which means that a variable reserves storage for a particular kind of data. For more information, see Variables.
- If the declaration is in a function, the identifier is in the
local scope of the function. For example, if the function
getCustomer()declares the variablerunningBalance, any code ingetCustomer()that follows the declaration can referencerunningBalance.You can pass the variable as an argument to another function, but the original identifier is not available in the called function. Instead, the name of the corresponding parameter in the receiving function declaration is available in the called function.
- If the declaration is in a main part (such as a Program) but is
outside of any function (including the
main()function), the name is global to that part. Refer to the name without qualifying it in any function called by the part. For example, if a program declaresrunningBalanceoutside of a function and invokesgetCustomer(), which in turn invokesgetCustomerBalance(),runningBalanceis available throughout both functions.The names in a text or print form are global to the main part that references the form. Those names are available even if the form is not presented.
- If the declaration is in a Library part, but outside of a function, the identifier is in scope within the run unit (a set of programs that operate together; see Run unit).
- For an explanation of scope issues relating to a DataTable part, see DataTable part.