RESET


ANSI, NCHAR

 

The RESET instruction changes the form pointer of a character string variable. The instruction uses the following format:

 

 

[label]

RESET

{dest}[{sep}{pos}]

 

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.

pos

Required. A previously defined Character String Variable, a Numeric Variable, a single character Literal, Expression, decimal constant, or equivalent {ctrl} character that determines the new {dest} form pointer position.

Flags Affected: EOS

Note the following:

  1. The Form Pointer of {dest} is changed to the value specified by the second operand. If no {pos} operand is specified, the Form Pointer is set to one (1). The contents of {dest} remain unchanged.

  2. If the second operand is a numeric variable, its value is used. If it is a FORM and contains a fractional value, only the integer portion is used (i.e., 7 if 7.785).

  3. If the {pos} operand is a character string, the Form Pointed character sets the Form Pointer of {dest} using the following formula:

  4. Form Pointer = CHARACTER VALUE - 31
     

  5. If the {pos} operand is {char}, the character sets the Form Pointer of {dest} using the same formula as for character strings (above).

  6. If the new Form Pointer value is beyond the Length Pointer, the Length Pointer is set to the new Form Pointer value and the EOS Condition Flag is set.

  7. If the new Form Pointer value is beyond the Physical Length, the Form Pointer is set to the Physical Length and the EOS Condition Flag is set.

  8. Enhanced ARRAY processing is supported for the RESET instruction.

  9. The {pos} operand can not be a National Character String Variable or a National Character String Literal.

 

 

See Also: Example Code, BUMP, Character String Instructions

 

 



PL/B Language Reference REPLACE SCAN