MOVE - Numeric Field to Numeric Field Examples


Example 1:

 

  

MOVE

NUM1 TO NUM2

 

 

Variable

PL

Contents

Before:

NUM1

9

••50.7685

 

NUM2

8

•••25.50

 

After:

NUM1

9

••50.7685

 

NUM2

8

•••50.77

 

No Condition flag is set (all FALSE).

 

Example 2:

 

 

Variable

PL

Contents

Before:

NUM1

9

••••••••0

 

NUM2

7

•150.00

 

After:

NUM1

9

••••••••0

 

NUM2

7

••••.00

 

The ZERO Condition flag is set since NUM2 has a zero value.

 

Example 3:

 

 

Variable

PL

Contents

Before:

NUM1

9

153750.00

 

NUM2

7

••••.00

 

After:

NUM1

9

153750.00

 

NUM2

7

3750.00

 

The OVER Condition flag is set since significant digits were lost.

 

Example 4:

 

 

Variable

PL

Contents

Before:

NUM1

9

••-100.00

 

NUM2

9

••••50.75

 

After:

NUM1

9

••-100.00

 

NUM2

9

••-100.00

 

The LESS Condition flag is set since NUM2 has a negative value.

 

Example 5:

 

 

MOVE

ARRAY(3) TO OUTPUT

 

 

Variable

PL

Contents

Before:

ARRAY(3)

8

•1234.56

 

OUTPUT

6

••1015

 

After:

ARRAY(3)

8

•1234.56

 

OUTPUT

6

••1235

 

No Condition flag is set (all FALSE).

 

 



PL/B Language Reference MOVE - Numeric Field to Integer Examples MOVE - RECORD to RECORD Example