CMOVE
The CMOVE instruction transfers a single character from the source operand to the destination character string. The instruction uses the following format:
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
source
Required. A previously defined Character String Variable, a single character Literal, a National Character String Variable, a National Character String Literal, a {ctrl} representation or an EQUATEd value that is moved to the {dest} value.
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 or National Character String Variable that receives the {source} value.
Flags Affected: EOS
Note the following:
The Form Pointed character of {source} or the character specified in {source} is moved into {dest} at its Form Pointed position.
The Form Pointer and Length Pointer of both operands remain unchanged.
If either operand is a Null String, no data transfer occurs and the EOS Condition Flag is set.
Enhanced ARRAY processing is supported for the CMOVE instruction.
Since CMOVE only accepts a single source character, no forcing character is required or allowed. To move a literal hash mark, use a single character literal source parameter ("#").
Example 1:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ABCDEFGH·· |
|
|
|
|
|
|
123456 |
|
| |||||
|
|
|
|
|
|
ABCDEFGH·· |
|
|
|
|
|
|
12E456 |
No Condition Flags are set (all FALSE).
Example 2:
|
|
|
|
|
|
|
|
|
|
|
|
|
ABCDEFGH·· |
|
|
|
|
|
|
123456 |
|
| |||||
|
|
|
|
|
|
ABCDEFGH·· |
|
|
|
|
|
|
123456 |
The EOS Condition Flags are set. RECVING is a null string.
Example 3:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123456 |
|
| |||||
|
|
|
|
|
|
123X56 |
No Condition Flags are set (all FALSE).
Example 4:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ABCDEFGH·· |
|
| |||||
|
|
|
|
|
|
ABCD#FGH·· |
No Condition Flags are set (all FALSE).
See Also: MOVE, Character String Instructions
![]() |