BUMP


 

The BUMP instruction increments or decrements the form pointer of the destination string variable. The instruction uses the following format:

 

 

[label]

BUMP

{dest}[{sep}{count}]

 

Where:

label

Optional. A Program Execution Label.

dest

Required. A previously defined Character String Variable or National Character String Variable whose form pointer is modified.

sep

Required. A comma or one of the following prepositions: BY, TO, OF, FROM, USING, WITH, IN, or INTO.

count

Required. A previously defined Numeric Variable, decimal constant, Expression, or equivalent {ctrl} character added to the form-pointer of the {dest} variable.

Flags Affected: EOS

Note the following:

  1. If the {count} operand is not specified, the Form Pointer of {dest} is incremented by one.

  2. If the {count} operand is specified, the Form Pointer of {dest} is incremented by the value specified or the integer value of the variable (i.e., 5 if 5.75).

  3. If the new Form Pointer exceeds the Length Pointer or is beyond of the physical boundaries of {dest}, the Form Pointer does not change and the EOS Condition Flag is set.

  4. Enhanced ARRAY processing is supported for the BUMP instruction.

 

Example 1:

 

  

BUMP

RECVING

 

 

Variable

PL

FP

LP

Contents

Before:

RECVING

20

6

14

ABCDEFGHIJKLMN······

 

After:

RECVING

20

7

14

ABCDEFGHIJKLMN······

 

No Condition Flags are set (all FALSE).

 

Example 2:

 

  

BUMP

RECVING

 

 

Variable

PL

FP

LP

Contents

Before:

RECVING

20

10

10

ABCDEFGHIJKLMN······

 

After:

RECVING

20

10

10

ABCDEFGHIJKLMN······

 

The EOS Condition Flag is set. The new Form Pointer would exceed the Length Pointer.

 

Example 3:

 

  

BUMP

RECVING BY 5

 

 

Variable

PL

FP

LP

Contents

Before:

RECVING

20

 1

14

ABCDEFGHIJKLMN······

 

After:

RECVING

20

 6

14

ABCDEFGHIJKLMN······

 

No Condition Flags are set (all FALSE).

 

Example 4:

 

 

BUMP

RECV(9) BY FPNUMBER

 

 

Variable

PL

FP

LP

Contents

Before:

FPNUMBER

 

 

 

5

 

RECV(9)

20

6

14

ABCDEFGHIJKLMN······

 

After:

FPNUMBER

 

 

 

5

 

RECV(9)

20

11

14

ABCDEFGHIJKLMN······

 

No Condition Flags are set (all FALSE).

 

Example 5:

 

 

BUMP

RECV(9) BY FPNUMBER

 

 

Variable

PL

FP

LP

Contents

Before:

FPNUMBER

 

 

 

-3

 

RECV(9)

20

11

14

ABCDEFGHIJKLMN······

 

After:

FPNUMBER

 

 

 

-3

 

RECV(9)

20

8

14

ABCDEFGHIJKLMN······

 

No Condition Flags are set (all FALSE).

 

 

See Also: RESET, Character String Instructions

 



PL/B Language Reference APPEND CHOP