REMOVE Statement

The functionality of the REMOVE statement can be configured to act as expected by the compatibility system by flags within the Compatibility Switch Matrix (set with the $OPTIONS statement).

FLAG

REMOVE.RESTART

Allows REMOVE to restart from the start of the string depending on the state and value of the setting-var variable.

If the setting-var variable has the value -1 or is unassigned when it is passed to the REMOVE statement, the internal REMOVE pointer is reset to the beginning of the array.

REMOVE.LAST

If set the REMOVE statement will return a zero instead of a one in the setting variable when returning the last field of a string.

REMOVE.PEOS

If set REMOVE will return a one instead of a zero in its setting variable when removing past end of string.

Example

The compatibility switch matrix values are as follows:

BCC Entry

Reality

D3

mvEnterprise

REMOVE.LAST

0

1

0

REMOVE.PEOS

0

0

1

Given the following three programs that only differ in name and first line:

Program Names = Reality.REM       D3.REM       MVE.REM
  First Lines = $OPTIONS REALITY  $OPTIONS D3  $OPTIONS MVENTERPRISE

The rest of the programs are the same as follows:

REMOVE VAR FROM A SETTING SET
CRT SQUOTE(VAR),SET
REMOVE VAR FROM A SETTING SET
CRT SQUOTE(VAR),SET

The expected output would be the following:

Reality.REM

D3.REM

MVE.REM

Comment

(VAR) - (SET)

(VAR) - (SET)

(VAR) - (SET)

 

("last") - (1)

("last") - (0)

("last") - (1)

REMOVE of last field

("") - (0)

("") - (0)

("") - (1)

REMOVE past end of string