INIT Examples


Example 1:

 

VERSION

INIT

"VERSION NUMBER 3.0"

 

VERSION is a character string variable containing `VERSION NUMBER 3.0'. VERSION has a Physical Length of 18, a Form Pointer of one (set to the `V') and a Length Pointer of 18 (set to the last character given - the zero).

 

Example 2:

 

STORENO

INIT

%"935"

 

STORENO is a character string variable containing '935'. STORENO has a Physical Length of three, a Form Pointer of one, and a Length Pointer of three. It is placed in the Global Data Area.

 

Example 3:

 

LIST

INIT

0b00110001,0x32,063

(or)

LIST

INIT

061,"2",0x33

 

LIST is a character string variable containing `123' (the ASCII equivalent of the three valid string literals). LIST has a Physical Length of three, a Form Pointer of one and a Length Pointer of three (set to the last Ctrl code given - the three).

 

Example 4:

 

PTRINIT

INIT

^

INIT1

INIT

"Level 1 Totals"

INIT2

INIT

"Level 2 Totals"

  

...

 

  

CALL

SUB USING INIT1

  

CALL

SUB USING INIT2

  

...

 

SUB

LROUTINE

PTRINIT

  

...

 

  

PRINT

*F,*50,PTRINIT

  

...

 

  

RETURN

 

 

PTRINIT is a Pointer Variable that contains the address of another DIM or INIT variable at execution time. This assignment is usually accomplished via the parameterized CALL instruction. Once initialized, PTRINIT may be used as any other DIM or INIT variable. It takes on all the attributes of the pointed to DIM or INIT variable.

 



PL/B Language Reference INDEX Examples INSERT (IFILE) Examples