11.04.2013 Views

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

$IFDEF<br />

Syntax<br />

1-31 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong><br />

$IFDEF var statements1 [$ELSE statements2] $ENDIF<br />

Description<br />

The <strong>UniBasic</strong> $IFDEF command conditionally compiles <strong>UniBasic</strong> statements<br />

depending on the existence of a variable definition. Variables are defined by<br />

$DEFINE.<br />

Parameters<br />

The following table describes each parameter of the syntax.<br />

Parameter Description<br />

var Specifies variable to check to determine whether to compile statements1<br />

or statements2.<br />

statements1 Specifies statements to compile if var is defined.<br />

statements2 Specifies optional statements to compile if var is not defined.<br />

$IFDEF Parameters<br />

Examples<br />

In the following example, when you compile the program segment, the system<br />

defines array1 as a 10-element array initialized with 0:<br />

$DEFINE SMALL<br />

$IFDEF SMALL<br />

DIM array1(10)<br />

MAT array1 = 0<br />

$ENDIF

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!