MOVE - Character String to Numeric Field


ANSI

 

This MOVE instruction transfers the Logical String contents of the source character string to the destination numeric variable. The instruction uses the following format:

 

 

[label]

MOVE

{source}{sep}{dest}

 

Where:

label

Optional. A Program Execution Label.

source

Required. A Character String Variable or Literal that serves as the source operand.

sep

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

dest

Required. A Numeric Variable that serves as the destination operand.

Flags Affected: EOS, LESS, OVER, ZERO

Note the following:

  1. The transfer from the {source} operand begins at the Form Pointed character and continues through the Length Pointed character (i.e., the Logical String) or until {dest} is full (whichever occurs first). The {source} operand remains unchanged.

  2. If the {source} variable is not in valid numeric format (decimal point, sign and digits) or if it is a Null String, no data transfer takes place and the EOS flag is set.

  3. The data transferred from the {source} operand is rounded and truncated to fit the format of {dest}. All arithmetic rules apply including rounding, truncation and setting of the ZERO, LESS, and OVER Condition Flags.

  4. Moving a character string variable containing a minus overpunched digit as the least significant byte into a valid numeric variable is allowed unless there is an environment variable PLB_DPT=on. If this variable is found, any DIM field containing a minus overpunched character is treated as an invalid numeric format.

 

 

See Also: Example Code, MOVE

 



PL/B Language Reference MOVE - Character String to Character String MOVE - Character String to Integer