Skip to main content
Previous section   Next section

Erase

Removes the named variable and deallocates dynamic-array storage space.

Synopsis

Erase varname

Arguments

The Erase statement has the following argument:

varname The name of the variable to be erased.

Description

The Erase statement removes the variable and all descended nodes.

Erase may be used to insure that a variable has no defined value, such as when a named variable is used as a placeholder in an argument list.

Examples

The following example uses Erase to remove an array and its subnodes:

array = "root node"
array("subnode") = "subnode"
array("subnode", "subnode") = "subnode, subnode"
Println Exists(array) 'returns 3; variable defined and has array elements
Erase array 
Println Exists(array) 'returns 0
Copy code to clipboard

The following example uses Erase to specify an explicitly undefined placeholder variable:

  Erase blankvar
  tStatement = New %SQL.Statement(blankvar,"Sample")
  PrintLn "Success"
Copy code to clipboard

See Also