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
◄Up► ◄Contents► ◄Index► ◄Back►
─────AUTOMATIC──────────────────────────────────────────────────────────────
Action
Declares specified variables on the stack, rather than at a static
memory location.
Syntax
AUTOMATIC [names]
Parameter Description
names A list of variables or array names to be made
automatic. Separate multiple names with commas.
Remarks
All variables are static by default.
If an AUTOMATIC statement contains no variable names, all the
variables within that program unit that can legally be automatic are
implicitly automatic.
Common-block names and variables are not allowed in an AUTOMATIC
statement. A variable cannot appear in both a SAVE statement and an
AUTOMATIC statement.
Variables with the ALLOCATABLE, EXTERNAL, FAR, or HUGE attribute
cannot be automatic. Formal arguments may not be declared automatic.
A variable that has been explicitly declared automatic may not
appear in a DATA or EQUIVALENCE statement. Variables that are
implicitly automatic and appear in a DATA statement will be
initialized and placed in static memory. A variable may appear
in an AUTOMATIC statement only once.
Formal arguments and procedure names may not appear in an
AUTOMATIC statement.
See Also: ◄4{Y | N}a compiler option►
Example
C In this example, all variables within the program unit
C are automatic, except for "clark" and "lois"; these are
C explicitly declared in a SAVE statement, and thus have
C static memory locations:
INTEGER FUNCTION Fibonacci (clark, lois)
AUTOMATIC
SAVE clark, lois
...
END
-♦-