NFORMAT Examples


Example 1:

 

  

NFORMAT

FORMFLD TO 10 WITH 3

 

 

Variable

Format

Contents

Before:

FORMFLD

18.2

••••••••••••••••12.12

 

After:

FORMFLD

10.3

••••••••••.000

 

No Condition Flag is set.

 

Example 2:

 

  

NFORMAT

FIELD TO 5 WITH 0

 

 

Variable

Format

Contents

Before:

FIELD

3

254

 

After:

FIELD

3

254

 

The OVER Condition Flag is set and the variable remains unchanged. FIELD was originally compiled with a size of 3 bytes.

 

Example 3:

 

ARRAY1

FORM

10(10)

ARRAY2

FORM

1(10)

ARRAY3

FORM

1(10)

  

...

 

  

NFORMAT

ARRAY1,ARRAY2,ARRAY3

 

Performs an NFORMAT of all array elements in ARRAY1 using the current values of each array element in ARRAY2 and ARRAY3.

 

Example 4:

 

ARRAY1

FORM

10(10)

X

FORM

2

Z

FORM

2

  

...

 

  

NFORMAT

ARRAY1,X,Z

 

Performs an NFORMAT of each array element in ARRAY1 using the current value of X and Z.

 

 



PL/B Language Reference MUNDEF Example NORETURN Example