SETREM |
|
|
The SETREM statement sets the remove pointer of a string.
Format
SETREM offset ON string
where
Assigning a character string variable automatically sets the remove pointer to zero, effectively pointing one character before the start of the string. The SETREM statement allows an application to set the remove pointer to an arbitrary offset into string. The STATUS() function will return zero if the action is successful.
If the offset is less than zero, zero is assumed. If the offset is greater than the length of string, the remove pointer is set to point one character beyond the end of the string.
SETREM is typically used with GETREM() to save and restore the remove pointer position.
Example
RMV.PTR = GETREM(S) GOSUB PROCESS.DATA SETREM RMV.PTR ON S
The above code fragment saves the remove pointer associated with string S and restores it after execution of subroutine PROCESS.DATA which might change this remove pointer.
See also: |