undef

Summary

Destroys previously defined variable(s).

Usage

{undef [ $var1 [ ... ] ]}

Parameters

NameTypeDescriptionRequired
var1 string The name of the variable that should be destroyed ($-notation). No.

Description

This function destroys variables that have previously been created using the "def" function. The names of the variables that should be destroyed can be provided as parameters. If no parameters are specified, the function will automatically get rid of all variables that were previously defined within the current/same namespace.

Examples

Example 1

{def $a=1 $b=2 $c=3}
...
{undef}

This example demonstrates how the "undef" function can be used to clean up / get rid of a previously the variables that were previously created using the "def" function .

Example 2

{def $a=1 $b=2 $c=3}
...
{undef $b}

This example demonstrates how the "undef" function can be used to clean up / get rid of a previously created variable. The variables $a and $c will not be destroyed.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2013 eZ Systems AS (except where otherwise noted). All rights reserved.