$DEFINE Statement

Declares a symbol for use in a DataBasic program.

Syntax

$DEFINE symbol {value}

Syntax Elements

symbol An identifier to be used as a symbol.

value Any valid DataBasic expression.

Operation

$DEFINE can be used in two ways:

A symbol defined with $DEFINE can be undefined with the $UNDEFINE statement. It can then be defined again with $DEFINE. Note, however, the following restrictions:

Comments

Refer to the EQUATE statement for more information about defining a symbol to be equivalent to a DataBasic expression.

See Also

EQUATE statement, $IFDEF statement, $IFNDEF statement, $UNDEFINE statement.

Examples

$DEFINE PI 3.1416

Declares symbol PI to be equal to 3.1416.

$DEFINE PART.NO ITEM(3)

Equates PART.NO to array element number 3 of ITEM.

$DEFINE TODAY DATE() 'DJ'

Equates symbol TODAY to the current date, formatted as the Julian day (1-365 or 1-366 for a leap year).

$DEFINE DEBUG

Defines the symbol DEBUG. This can then be used with $IFDEF and $IFNDEF statements to include or exclude code from the compiled version.