LOADADR


8.7

 

The LOADADR statement loads the address of a variable found in a variable list into a destination pointer. The selection of a variable from the variable list is determined by an index. The instruction uses one of the following formats:

 

(1)

[label]

LOADADR

{destptr}{sep}{index}{sep}{var}[,{var}...]

(2)

[label]

LOADADR

{destptr}{sep}{index}{sep}{varlist}

(3)

[label]

LOADADR

{destptr}{sep}{index}{sep}{array}

 

Where:

label

Optional. A Program Execution Label.

destptr

Required. A PL/B Pointer Variable or VAR that is set.

sep

Required. A comma or one of the following prepositions: BY, TO, OF, FROM, USING, WITH, IN, or INTO.

index

Required. A Numeric Variable or literal that indicates which variable is loaded.

var

Required. A variable whose type is the same as {destptr}.

varlist

Required. A VARLIST of variables whose types are compatible with {destptr}.

array

Required. A Array of variable pointers whose types are compatible with {destptr}

Flags Affected: NONE

Note the following:

  1. The selection of a variable from the variable list is determined by the {index} value.

  2. The {index} value references individual elements in the {array} variable. However, if the {destptr} is an array pointer variable, it is processed as a single variable in the variable list. In this case, the address of the {array} variable is loaded into the {destptr}.

  3. If the {index} value is zero or greater than the number of variables processed in the variable list, no action is taken and the {destptr} remains unchanged.

  4. If the {destptr} variable is a VAR typeless variable, no type checking is done.

 

 

See Also: Example Code, MOVEADDR, MOVEPTR, SMAKE, CLEARADR, STOREADR, System Interface Instructions

 



PL/B Language Reference GETSTRING LOADLABEL