StaticVarInfo
- get the information about static variable(s)

Miscellaneous functions
(AmiBroker 5.60)


SYNTAX StaticVarInfo( ''varname'', ''field'' )
RETURNS STRING or NUMBER
FUNCTION The function provides information about static variables.

Arguments:

  • "varname" - is a variable name. It can be also a wildcard template such as "myvariable*" and then it means that AmiBroker will search for all variables beginning with " myvariable". * character matches any string, ? matches any single character
  • "field" - defines the information to retrieve. Supported "field" values are:
    • "list" - returns the list of static variables
    • "memory" - returns memory usage in bytes (not including memory used for variable name itself)
    • "totalmemory" - returns memory usage in bytes (including memory used for variable name)
    • "count" - returns the number of static variables matching the wildcard string (new in AmiBroker 6.90)
EXAMPLE StaticVarSet("my_array1", Close );
StaticVarSet("my_array2", Close );
StaticVarSet("my_scalar", 12 );
StaticVarSetText("my_text", "Text123456" );

"All variables in memory: " + StaticVarInfo( "*", "list" );
" Total static var memory: " + StaticVarInfo( "*", "totalmemory");
" Only my_ variables: " + StaticVarInfo( "my_*", "list" );
" Memory 2 arrays (bytes): " + StaticVarInfo( "my_array*", "memory" );
" Memory scalar (bytes): " + StaticVarInfo( "my_scalar", "memory" );
" Memory text (bytes): " + StaticVarInfo( "my_text", "memory" );
SEE ALSO StaticVarCompareExchange() function , StaticVarCount() function , StaticVarGet() function , StaticVarGetText() function , StaticVarRemove() function , StaticVarSet() function , StaticVarSetText() function

References:

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

More information:

See updated/extended version on-line.