- Sets the value of static string variable.

Miscellaneous functions
(AmiBroker 4.60)

SYNTAX StaticVarSetText( ''varname'', ''value'', persist = False )
FUNCTION Sets the value of static string variable. Returns 1 on success 0 on failure.

Static variable - the variable has static duration (it is allocated when the program begins and deallocated when the program ends) and initializes it to Null unless another value is specified. Static variables allow to share values between various formulas.

Starting from version 5.80 there is a new parameter 'persist'. If it is set to True then static variable will be stored in PersistVars.bin file when AmiBroker is closing and reloaded automatically on next startup, preserving the values of static variables between application runs). In addition to saving them automatically on exit, persistent static variables can be auto-saved at user-specified intervals using SetOption("StaticVarAutoSave", interval );

SEE ALSO StaticVarSet() function , StaticVarGet() function


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

More information:

See updated/extended version on-line.