EGL Reference Guide for iSeries
A library part contains a set of functions, variables, and
constants that can be used by programs, page handlers, or other
libraries. It is recommended that you use libraries to maximize your
reuse of common code and values.
Rules are as follows:
- Libraries are available only if you generating Java output.
- You can reference a library's functions, variables, and constants
without specifying the library name, but only if you include the library in a
program-specific Use declaration.
- Library functions can access any system variables that are associated with
the invoking program or page handler.
- Library functions can use any statements except these:
- converse
- display
- forward
- show
- transfer
- A library that accesses a text or print form must include a use
declaration for the related form group. The form can be presented only
in non-segmented mode because the library cannot go out of memory except as
described later.
- You can use the modifier private on a function, variable, or
constant declaration to keep the element from being used outside the
library.
- Library functions that are declared as public (as is the default) are
available outside the library and cannot have parameters that are of a loose
type, which is a special kind of primitive type that is available only if you
wish the parameter to accept a range of argument lengths. For details
on the loose type, see Function part in EGL source format.
The library is generated separately from the parts that use it. At
run time, the library is loaded when first used and is unloaded when the
program or page handler that accessed the library leaves memory, as occurs
when the run unit ends or when a program (if segmented) issues a converse
statement. .
A page handler gets a new copy of the library whenever the page handler is
loaded. Also, a library that is invoked by another library remains in
memory as long as the invoking library does.
In EGL-generated Java code, a library that is used only for its constants
is not loaded at run time because constants are generated as literals in the
programs and page handlers that reference them.
Related reference
converse
forward
Function part in EGL source format
Run unit
Segmentation in text applications
show
transfer
Use declaration
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.