LCMOVE


 

The LCMOVE instruction moves a single character from the source string to the destination string. The instruction uses the following format:

 

 

[label]

LCMOVE

{source}{sep}{dest}

 

Where:

label

Optional. A Program Execution Label.

source

Required. A previously defined Character String Variable that is moved to the {dest} variable.

sep

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

dest

Required. A previously defined Character String Variable that receives the {source} value.

Flags Affected: EOS

Note the following:

  1. The Length Pointed character in the source string is moved to the first character position in the destination string. The contents of the {source} operand remains unchanged.

  2. No changes are made to the Form Pointers or Length Pointers of operand.

  3. If the Length Pointer of the {source} operand is zero (0), the EOS Condition Flag is set.

  4. This instruction is provided for compatibility only and it use is strongly discouraged.

 

Example 1:

 

  

LCMOVE

SENDING TO RECV(X)

 

 

Variable

PL

FP

LP

Contents

Before:

SENDING

10

1

5

ABCDE·····

 

RECV(X)

8

1

6

FZDCBA··

 

After:

SENDING

10

1

5

ABCDE·····

 

RECV(X)

8

1

6

EZDCBA··

 

No Condition Flags are set (all FALSE).

 

Example 2:

 

 

Variable

PL

FP

LP

Contents

Before:

SENDING

10

3

4

ABCDE·····

 

RECV(X)

8

6

6

FEDCBA··

 

After:

SENDING

10

3

4

ABCDE·····

 

RECV(X)

8

6

6

DEDCBA··

 

No Condition Flags are set (all FALSE).

 

Example 3:

 

 

Variable

PL

FP

LP

Contents

Before:

SENDING

10

0

0

ABCDE·····

 

RECV(X)

8

5

6

FEDCBA··

 

After:

Both variables remain unchanged.

 

The EOS Condition Flag is set. The source length pointer is zero.

 

 

See Also: CMOVE, Character String Instructions

 



PL/B Language Reference IMPLODE LENSET