HTBasic Help
×
Menu
Index

Static

 
STATIC is a data condition. STATIC variables are persistent during a single run of an HTBasic program. Typically, STATIC variables will only be used in SUB programs and/or FN functions because the MAIN context is usually called only once.
 
STATIC variables can effectively take the place of COM variables as they are presently used in many cases. If access to a COM variable is required in multiple SUBs and/or Functions (DEF FN) and/or the Main context, then a STATIC variable is not appropriate. The scope of a STATIC variable is limited to the context in which it is declared. In other words, a STATIC variable declared in a SUB program cannot be accessed anywhere other than within that particular SUB program.
 
Up to 6 bounds may be specified, the initial values are optional. Specifying an initial value for an array initializes each individual element in all dimensions of the array to the initial value specified.