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.

Example<br />

In the following example, the program segment nests the $IFDEF and $IFNDEF<br />

statements. Upon compilation of this program, the size of array A might be 1000, 10,<br />

or 100 depending on whether LARGE or SMALL is defined. If both are undefined,<br />

the size of A is 100 elements, and the initialized value of array A might be 1 or 0,<br />

depending on whether ONE is defined.<br />

$IFDEF LARGE<br />

DIM A(1000)<br />

$IFDEF ONE<br />

MAT A = 1<br />

$ELSE<br />

MAT A = 0<br />

$ENDIF<br />

$ELSE<br />

$IFNDEF SMALL<br />

DIM A(100)<br />

$ELSE<br />

DIM A(10)<br />

$ENDIF<br />

$IFDEF ONE<br />

MAT A = 1<br />

$ELSE<br />

MAT A = 0<br />

$ENDIF<br />

$ENDIF<br />

Related <strong>Commands</strong><br />

<strong>UniBasic</strong><br />

$DEFINE, $IFDEF<br />

$IFNDEF 1-34

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

Saved successfully!

Ooh no, something went wrong!