DataBasic Reference > Statements and Intrinsic Functions > $DEFINE Statement

Comment on this topic

Documentation Comments

Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.

RealityV15.1Online Documentation (MoTW) Revision 7

$DEFINE Statement (DataBasic) (m618703+define_s.htm)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

$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.

RealityV15.1 (MoTW) Revision 7Comment on this topic