Global function
Syntax
Global data_type &var_name
Description
Use the Global statement to declare PeopleCode global variables. A global variable, once declared in any PeopleCode program, remains in scope throughout the PeopleSoft session. The variable must be declared with the Global statement in any PeopleCode program in which it is used.
Declarations tend to appear at the beginning of the program, intermixed with function declarations.
Not all PeopleCode data types can be declared as Global. For example, ApiObject data types can only be declared as Local.
Parameters
| Parameter | Description |
|---|---|
|
data_type |
Specify a PeopleCode data type. |
|
&var_name |
A legal variable name. |
Example
The following example declares a global variable and then assigns it the value of a field:
Global string &ID;
&ID = AE_APPL_ID;