TEMPLATE Procedure: Creating Markup Language Tagsets

UNSET Statement

Deletes a user-defined variable and its value.

Syntax

Required Arguments

ALL
deletes all dictionary variables, list variables, and scalar variables.
Tip:You must delete stream variables individually.
dictionary-variable
specifies an array that contains a list of numbers or text strings that are identified by a key. A dictionary-variable has the following form:
$dictionary-variable['key']
['key']
specifies the location in the dictionary variable of the value that you want to delete.
Requirements:Enclose key in quotation marks and brackets.

key must be a string of text or a character variable.

Tip:key is case preserving and case sensitive.
Requirement:A dictionary-variable must be preceded by the '$' symbol.
list-variable
specifies an array that contains a list of numbers or strings of text that are indexed. A list-variable has the following form:
$list-variable[<index>]
[<index>]
specifies the location in the list variable of the value to be deleted. If you omit the index and specify empty brackets, then the entire list variable is deleted.
Requirements:Specify brackets [ ], even if you omit an index.

index must be number or numeric variable.

Enclose index in brackets.

Tip:List entries are accessed by positive or negative indexes. Positive indexes start at the beginning of a list. Negative indexes start at the end of a list. For example, in the following code, the first UNSET statement deletes the first entry from the top of the list variable MyList. The second UNSET statement deletes the first entry from the bottom of the MyList list variable:
unset $mylist[-1];
 unset $mylist[1];
Requirement:A list-variable must be preceded by a '$' symbol.
scalar-variable
specifies a scalar variable to delete.
Requirement:Scalar variables must be preceded by the '$' symbol.
See:SET Statement or Understanding Variables for information about scalar variables
stream-variable
specifies a stream variable to delete.
Requirement:A user-defined-variable-name must be preceded by the '$$' symbol.
Tip:If you assign a variable entry that is the name of a memory variable to stream-variable, then the stream variable resolves as the value of the memory variable. For example, the following program uses the memory variable $MyStream as a stream variable:
set $mystream 'test';
 open $mystream;
 put 'The memory variable $mystream is being used as a stream variable';
 close;
Therefore, the following statements are equivalent:
put $$test;
 putstream $mystream;
 putstream test;
The following statements are also equivalent:
unset $$test;
 delstream $mystream;
 delstream test;
See:SET Statement or Understanding Variables for information about memory variables.

Optional Argument

event-statement-condition(s)
specifies one or more conditions that must be true for the event statement to execute.
Requirement:An event-statement-condition must be preceded by a slash (/).
See: For information about these conditions, see Event Statement Conditions.