SETLPTR
ANSI, NCHAR
The SETLPTR instruction changes the value of the length pointer (LP). The instruction uses the following format:
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
dest
Required. A previously defined Character String Variable or National Character String Variable whose length pointer is modified.
sep
Required. A comma or one of the following prepositions: BY, TO, OF, FROM, USING, WITH, IN, or INTO.
pos
Optional. A previously defined Character String Variable, Numeric Variable, single character Literal, Expression, decimal constant or equivalent {ctrl} character that determines the new {dest} length pointer position.
Flags Affected: EOS, OVER
Note the following:
If no {pos} variable is specified, the Length Pointer of {dest} is set to the Physical Length.
If the second operand is a decimal constant, the Length Pointer is set to its value.
If {pos} is a character string, the Form
Pointed character sets the Length Pointer of {dest} using
the following formula:
Form Pointer = CHARACTER VALUE - 31
If {pos} is a single character literal, the specified character is used according to the same formula as for a character string (above).
If {pos} is a numeric variable, only the integer portion is used (i.e., 8 if 8.67).
The Length Pointer may be set between zero and the Physical Length of {dest}.
If the new Length Pointer is less than the Form Pointer, the Form Pointer is set to the new Length Pointer and the EOS Condition Flag is set.
If the new Length Pointer is outside the Physical Length of {dest}, the pointers remain unchanged and the OVER Condition Flag is set.
Enhanced ARRAY processing is supported for the SETLPTR instruction.
The {pos} operand can not be a National Character String Variable or a National Character String Literal.
See Also: Example Code, LENSET, Character String Instructions
![]() |