Skip to content
bergsma edited this page Sep 26, 2014 · 5 revisions

#undef

###The undef function undefines a variable.

Syntax

status = undef variable ;

Arguments

  1. list variable

A valid identifier.

Return Value

str status
  • $ACKNOWLEDGE : The variable was undefined.

The STATUS variable is set to $ACKNOWLEDGE

str status
  • $ACKNOWLEDGE : The variable was undefined.

The STATUS variable is set to $ACKNOWLEDGE

Exceptions

  • %ARGUMENT: Invalid arguments. Usage: status = undef variable ;

  • %IDENTIFIER: 'variable' argument is not a valid identifier, literal, or reference

Description

A variable can be undefined with the undef() function. If in local scope, and both a local and global variable of the same name exist, then undef() will delete the local variable first. If in global scope, and both a local and global variable of the same name exist, then undef() will delete the global variable.

Examples

a = 1 ;
if ( exists a )
  puts “’a’ exists” ;

undef a ;
if ( !exists a )
  puts “’a’ exists not

Related Links

exists

Clone this wiki locally