CONST Example


Example:

 

.Define a variable that may be used

. both as a numeric literal and numeric constant

.

MAXNDX

CONST

"12"

NDX

FORM

2

ARRAY

DIM

8(MAXNDX)

  

...

 

  

FOR

NDX,"1",MAXNDX

  

...

 

  

REPEAT

 

 

This example shows the definition of a CONST value named MAXNDX. An array of size MAXNDX is then created and a loop is repeated MAXNDX size. Through use of the constant value, a change to the values of MAXNDX will alter the size of the array and the array processing loop.

 



PL/B Language Reference COMPRESS Example COPYFILE Example