StaticVarRemove
- remove static variable

Miscellaneous functions
(AmiBroker 4.80)


SYNTAX StaticVarRemove( ''variablename'' )
RETURNS NOTHING
FUNCTION This function removes static variable and releases associated memory.

With AmiBroker version 5.30, StaticVarRemove() supports wildcards in the variable name.

"varname" parameter can be either exact variable name or wildcard match string.

The '*' matches any number of characters, including zero characters. The '?' matches exactly one character.

Example 1:

StaticVarRemove("MyVariables*");
// this will remove all static variables beginning with MyVariables prefix.

EXAMPLE StaticVarSet("DifferentName", 1 );

printf( "Total static variables = %g\n\n", StaticVarCount() );

for( i = 1; i <= 5; i++ )
  
for( j = 1; j <= 5; j++ )
   {
     VarName =
"Test_X=" + i + "_Y=" + j;
    
printf("Setting variable " + VarName + "\n" );
    
StaticVarSet( Varname, 1 );
   }

printf( "Total static variables = %g\n\n", StaticVarCount() );

printf( "Now wildcard remove *X=1*\n" );

StaticVarRemove( "*X=1*" );

printf( "Total static variables = %g\n\n", StaticVarCount() );

printf( "Now wildcard remove Test*\n" );

StaticVarRemove( "Test*" );

printf( "Total static variables = %g\n\n", StaticVarCount() );

printf("Removing 'differenname' variable\n");

StaticVarRemove("DifferentName" );

printf( "Total static variables = %g\n\n", StaticVarCount() );

SEE ALSO StaticVarGet() function , StaticVarGetText() function , StaticVarSet() function , StaticVarSetText() function

References:

The StaticVarRemove function is used in the following formulas in AFL on-line library:

More information:

See updated/extended version on-line.