bas7qck.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Automatic and Static Variables
  Variables                                    Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
Automatic and Static Variables
 
BASIC procedures can use automatic and static variables:
  ■ Automatic variables are initialized at the start of each call to the
    FUNCTION or SUB.
  ■ Static variables retain values between calls.
 
Use STATIC keyword in the SUB or FUNCTION statement to control whether the
procedure's variables are automatic or static:
  ■ If you omit the STATIC keyword, then the variables are automatic.
  ■ When you use STATIC, then the variables in the procedure are static:
    the values of the variables are saved between procedure calls.
 
You can make selected variables in a procedure static:
  ■ Make the default automatic by omitting STATIC from the SUB or FUNCTION
    statement.
  ■ Then name one or more variables in a STATIC statement.