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.
DECLARE Statement
◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
Declares a FUNCTION or SUB procedure and invokes argument data type checking.
DECLARE {FUNCTION | SUB} name [([parameterlist])]
■ name The name of the procedure.
■ parameterlist One or more variables that specify parameters to be
passed to the procedure when it is called:
variable[( )] [AS type] [, variable[( )] [AS type]]...
variable A Basic variable name.
type The data type of the variable (INTEGER,
LONG, SINGLE, DOUBLE, STRING, or a
user-defined data type). ANY allows any
data type.
■ DECLARE is required if you call SUB procedures without CALL. QBasic
automatically generates DECLARE statements when you save your program.
Example:
The program REMLINE.BAS illustrates declaring FUNCTION and SUB
procedures. To view or run this program, load REMLINE.BAS using the Open
command from the File menu.
See Also ◄CALL► ◄FUNCTION► ◄SUB►