$DELG

From m204wiki
Revision as of 13:18, 20 April 2013 by Alex (talk | contribs) (Automatically generated page update)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Deletes information stored in the global variable table by a $SETG function in the same or an earlier request.

The syntax of the $DELG function is:

$DELG('globalvariable[*]')

Where:

globalvariable[*] specifies the name of the global variable to delete.

You can specify the optional wildcard suffix, an asterisk (*), to delete all global variables with the same common prefix. You cannot delete all global variables by specifying the wildcard suffix only.

$DELG returns a completion code indication success or failure of the operation. Possible codes are:

Code Meaning
0 Successful. Global variable(s) deleted.
1 Not found. No global variable found that matches the supplied argument.
2 Unsuccessful.

Examples

Assuming the global variable table has been populated as follows:

%RC = $SETG('GVAR','DATA') %RC = $SETG('GVAR1','DATA1') %RC = $SETG('DELETE','TARGET') %RC = $SETG('GVAR2','DATA2') %RC = $SETG('REMAINING','ENTRY') %RC = $SETG('GVAR3','DATA3')

Then the following $DELG functions return:

Function Returns... And...

%RC=$DELG()

1 Does not alter the global variable table

%RC=$DELG('DELETE')

0 Removes the entry DELETE from the global variable table

%RC=$DELG('NOTFOUND')

1 Does not alter the variable table

%RC=$DELG('GVAR*')

0 Removes all GVARn entries, including GVAR, from the global variable table

%RC=$DELG('*')

1 Does not alter the global variable table

The resulting global variable table is:

REMAINING=ENTRY

For a full discussion of global variables refer to Global Features.