You are here: Job and Form Set Rules Reference > JDT Rules Reference > CreateGlbVar

CreateGlbVar

Use this job level rule to create a global variable which can be used by all code in the system. You specify the type and size of the variable. List all instances of this rule at the beginning of the AFGJOB.JDT file.

Syntax

;CreateGlbVar;;;

     
Note This rule resets the global variable created during pre-processing.

Example

;CreateGlbVar;;VARIABLENAME, VARTYPE, VARSIZE;

You can create each global variable as shown below. VARIABLENAME is an arbitrary name of the variable which will be created, VARTYPE is the type of variable to create, and VARSIZE is an optional size of the variable to create.

The variable types are:

The following example creates a character array of 20 bytes named MYCHARARRAY. Remember that the array should be large enough to include the null terminating character if it contains strings.

;CreateGLBVar;1;MYCHARARRAY,CHAR_ARRAY,20;

The next example creates a variable named MYLONGVAR that is a long:

;CreateGlbVar;1;MYLONGVAR,LONG;

Notice that no size was included so the variable size will be a single long value.