Function variables

The syntax diagram for each variable in a function is as follows:

Syntax diagram for function data other than parameters
primVarName
Specifies the name of a local primitive variable. For details on usage in the function, see References to variables and constants. For other rules, see Naming conventions.
primitiveType
The type of a primitive field. Depending on the type, the following information may be required:
  • The parameter's length, which is an integer that represents the number of characters or digits in the memory area.
  • For some numeric types, you may specify an integer that represents the number of places after the decimal point. The decimal point is not stored with the data.
  • For an item of type INTERVAL or TIMESTAMP, you may specify a datetime mask, which assigns a meaning (such as "year digit") to a given position in the item value.
dataItemPartName
The name of a dataItem part that is visible to the program. For details on visibility, see References to parts.

The part acts as a model of format, as described in Typedef.

size
Number of elements in the array. If you specify the number of elements, the array is initialized with that number of elements.
set-value block
For details, see Overview of EGL properties and Set-value blocks
= literal
Specifies the initial value of the primitive variable.
varName
Name of the variable, which can be of any type that is based on a part.
partName
Name of a part that is visible to the program or is predefined. For details on visibility, see References to parts.

The part acts as a model of format, as described in Typedef.

const constantName primitiveType=literal
Name, type, and value of a constant. Specify a quoted string (for a character type); a number (for a numeric type); or an array of appropriately typed values (for an array). Examples are as follows:
  const myString String = "Great software!";
  const myArray  BIN[] = [36, 49, 64];
  const myArray02 BIN[][] = [[1,2,3],[5,6,7]];

For the rules of naming, see Naming conventions.

Related concepts
Function part
Parts
References to parts
References to variables in EGL
Syntax diagram for EGL statements and commands
Typedef

Related tasks
Function part in EGL source format

Related reference
Arrays
INTERVAL
Naming conventions
TIMESTAMP

Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.