COMPARE Examples


Example 1:

 

  

COMPARE

SENDING TO RECVING

 

 

Variable

Format

Contents

Before:

SENDING

6

•200.0

 

RECVING

3

200

 

After:

Both operands remain unchanged.

 

The ZERO Condition Flag is set.

 

Example 2:

 

 

Variable

Format

Contents

Before:

SENDING

3

500

 

RECVING

2

•0

 

After:

Both operands remain unchanged.

 

The LESS Condition Flag is set.

 

Example 3:

 

 

Variable

Format

Contents

Before:

SENDING

3

•50

 

RECVING

4.1

•200.0

 

After:

Both operands remain unchanged.

 

No Condition Flag is set.

 

Example 4:

 

 

Variable

Format

Contents

Before:

SENDING

1

1

 

RECVING

3

-99

 

After:

Both operands remain unchanged.

 

The LESS Condition Flag is set.

 

Example 5:

 

  

COMPARE

"500.00" TO RECV(X)

 

 

Variable

Format

Contents

Before:

RECV(X)

2.2

75.00

 

After:

RECV(X) remains unchanged.

 

The LESS Condition Flag is set.

 

 



PL/B Language Reference COMOPEN Examples COMPRESS Example