Product SiteDocumentation Site

2.5. DROP


         +------------+
         V            |
>>-DROP----+-name---+-+--;-------------------------------------><
           +-(name)-+

DROP "unassigns" variables, that is, restores them to their original uninitialized state. If name is not enclosed in parentheses, it identifies a variable you want to drop and must be a symbol that is a valid variable name, separated from any other name by one or more whitespace characters or comments.
If parentheses enclose a single name, then its value is used as a subsidiary list of variables to drop. Whitespace characters are not necessary inside or outside the parentheses, but you can add them if desired. This subsidiary list must follow the same rules as the original list, that is, be valid character strings separated by whitespace, except that no parentheses are allowed. The list need not contain any names—that is, it can be empty.
Variables are dropped from left to right. It is not an error to specify a name more than once or to drop a variable that is not known. If an exposed variable is named (see Section 2.7, “EXPOSE” and Section 2.19, “PROCEDURE”), then the original variable is dropped.

Example 2.11. Instructions - DROP

j=4
Drop  a z.3 z.j
/* Drops the variables: A, Z.3, and Z.4              */
/* so that reference to them returns their names.    */

Here, a variable name in parentheses is used as a subsidiary list.

Example 2.12. Instructions - DROP

mylist="c d e"
drop (mylist) f
/* Drops the variables C, D, E, and F          */
/* Does not drop MYLIST                        */

Specifying a stem (that is, a symbol that contains only one period as the last character) assigns the stem variable to a new, empty stem object.
Example:
Drop  z.
/* Assigns stem variable z. to a new empty stem object */