Game Development Community

DeleteVariables();

by Yue -Rookie Torque 3D- · in Torque 3D Beginner · 08/29/2013 (11:16 am) · 2 replies

Hi, not quite understand if this should work this way.

$Message = "Hello";
DeleteVariables();
echo($Message);    //Message displayed in console

I thought that deletes the contents of the variable.

About the author

http://www.iris3d.tk -Games Studios- <<I do not speak English: I use the google translator>> My goal as a rookie is knowing Torque 3D


#1
08/29/2013 (11:36 am)
function deleteVariables( ( string pattern ) )
Undefine all global variables matching the given name @a pattern.
@param pattern A global variable name pattern.  Must begin with '$'.
@tsexample
// Define a global variable in the "My" namespace.
$My::Variable = "value";

// Undefine all variable in the "My" namespace.
deleteVariables( "$My::*" );
@endtsexample

@see strIsMatchExpr
#2
08/29/2013 (11:38 am)
For your example that would be:
$Message = "Hello";  
DeleteVariables("$Message");  
echo($Message);    // Echoes nothing