SETREM

Top  Previous  Next

 

The SETREM statement sets the remove pointer of a string.

 

 

Format

 

SETREM offset ON string

 

where

 

offsetis the character position (from 1) where the remove pointer is to be set.

 

stringis the string on which the remove pointer position is to be set.

 

 

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:

GETREM, REMOVE