You declare a library part in an EGL source file, which is described in EGL source format.
Library CustomerLib3 // Use declarations Use StatusLib; // Data Declarations exceptionId ExceptionId ; // Retrieve one customer for an email // In: customer, with emailAddress set // Out: customer, status Function getCustomerByEmail ( customer CustomerForEmail, status int ) status = StatusLib.success; try get customer ; onException exceptionId = "getCustomerByEmail" ; status = sqlCode ; end commit(); end // Retrieve one customer for a customer ID // In: customer, with customer ID set // Out: customer, status Function getCustomerByCustomerId ( customer Customer, status int ) status = StatusLib.success; try get customer ; onException exceptionId = "getCustomerByCusomerId" ; status = sqlCode ; end commit(); end // Retrieve multiple customers for an email // In: startId // Out: customers, status Function getCustomersByCustomerId ( startId CustomerId, customers Customer[], status int ) status = StatusLib.success; try get customers usingKeys startId ; onException exceptionId = "getCustomerForEmail" ; status = sqlCode ; end commit(); end end
The diagram of a library part is as follows:
For other rules, see Naming conventions.
The library is of type BasicLibrary by default.
All are optional:
Record aRecordPart type basicRecord 10 myItem01 CHAR(5); 10 myItem02 CHAR(5); end
myRecord aRecordPart;
myValue = myRecord.myItem01;
myValue = myItem01;
It is recommended that you accept the default value, which promotes a best practice. By specifying the container name, you reduces ambiguity for people who read your code and for EGL.
EGL uses a set of rules to determine the area of memory to which a variable name or item name refers. For details, see References to variables and constants.
The only value now available for callingConvention is I4GL. For additional details, see Library part of type NativeLibrary.
For additional details, see Library part of type NativeLibrary.
For other details, see VGVar.handleHardIOErrors and Exception handling.
If the library is using shared functions that are not in the library, generation is possible only if you set the property includeReferencedFunctions to yes.
If you specify no, the identifiers are shared throughout the run unit. The identifiers created when the SQL statements in the library is invoked are available in other code that invokes the library, although the other code can use localSQLScope = yes to block access to those identifiers. Also, the library may reference identifiers created in the invoking program or pageHandler, but only if the SQL-related statements were already run in the other code and if the other code did not block access.
In any case, the identifiers available when the program or pageHandler accesses the library are available when the same program or pageHandler accesses the same or another function in the same library.
You cannot specify private for a function in a library of type NativeLibrary.
The part acts as a model of format, as described in Typedef.
The part acts as a model of format, as described in Typedef.
A basic record has no properties.
Related concepts
EGL projects, packages, and files
Library part of type basicLibrary
Library part of type nativeLibrary
Library part of type ServiceBindingLibrary
Overview of EGL properties
References to parts
References to variables in EGL
Typedef
Related reference
Basic record part in EGL source format
DataTable part in EGL source format
EGL source format
Exception handling
Function part in EGL source format
Indexed record part in EGL source format
Input form
Input record
I/O error values
Java runtime properties (details)
MQ record part in EGL source format
Primitive types
Relative record part in EGL source format
Serial record part in EGL source format
SQL record part in EGL source format
VGUIRecord part in EGL source format
Use declaration
handleHardIOErrors