UniBasic Commands Reference - Rocket Software
UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software
$IFDEF Syntax 1-31 UniBasic Commands Reference $IFDEF var statements1 [$ELSE statements2] $ENDIF Description The UniBasic $IFDEF command conditionally compiles UniBasic statements depending on the existence of a variable definition. Variables are defined by $DEFINE. Parameters The following table describes each parameter of the syntax. Parameter Description var Specifies variable to check to determine whether to compile statements1 or statements2. statements1 Specifies statements to compile if var is defined. statements2 Specifies optional statements to compile if var is not defined. $IFDEF Parameters Examples In the following example, when you compile the program segment, the system defines array1 as a 10-element array initialized with 0: $DEFINE SMALL $IFDEF SMALL DIM array1(10) MAT array1 = 0 $ENDIF
In the next example, when you compile the program segment, the system defines array1 as a 100-element array and initializes it with 1: $UNDEFINE SMALL $IFDEF SMALL PRINT 'SMALL was defined' $ELSE DIM array1(100) MAT array1 = 1 $ENDIF Related Commands UniBasic $DEFINE, $IFNDEF $IFDEF 1-32
- Page 1 and 2: C:\Program Files\Adobe\FrameMaker8\
- Page 3 and 4: The above trademarks are property o
- Page 5 and 6: C:\Program Files\Adobe\FrameMaker8\
- Page 7 and 8: C:\Program Files\Adobe\FrameMaker8\
- Page 9 and 10: C:\Program Files\Adobe\FrameMaker8\
- Page 11 and 12: C:\Program Files\Adobe\FrameMaker8\
- Page 13 and 14: C:\Program Files\Adobe\FrameMaker8\
- Page 15 and 16: TRIMB . . . . . . . . . . . . . . .
- Page 17 and 18: UniBasic Commands and Functions Thi
- Page 19 and 20: ! ! is a synonym for the * and REM
- Page 21 and 22: #< #< is a synonym for the GE relat
- Page 23 and 24: $BASICTYPE Syntax $BASICTYPE "param
- Page 25: $DEFINE Syntax $DEFINE var Descript
- Page 29 and 30: Example In the following example, t
- Page 31 and 32: Parameters The following table desc
- Page 33 and 34: $UNDEFINE Syntax $UNDEFINE var Desc
- Page 35 and 36: * Syntax expr * expr Synonyms !, RE
- Page 37 and 38: *= Syntax var *= expr Description T
- Page 39 and 40: += Syntax var += expr Description T
- Page 41 and 42: -= Syntax var -= expr Description T
- Page 43 and 44: = Syntax var /= expr Description Th
- Page 45 and 46: ^ Syntax expr1^expr2 Synonym ** Des
- Page 47: < is a synonym for the LT (less tha
- Page 50 and 51: = 1-55 UniBasic Commands Reference
- Page 52 and 53: =< 1-57 UniBasic Commands Reference
- Page 54 and 55: 1-59 UniBasic Commands Reference >
- Page 56 and 57: @ Syntax @(col.expr [,row.expr]) @(
- Page 58 and 59: 1-63 UniBasic Commands Reference Op
- Page 60 and 61: Examples In the following example,
- Page 62 and 63: [] Syntax 1-67 UniBasic Commands Re
- Page 64 and 65: {} {} is a synonym for the CALCULAT
- Page 66 and 67: Note: You can use the ECL ON.ABORT
- Page 68 and 69: ABS Syntax ABS(expr) Description Th
- Page 70 and 71: Parameter Description 1-76 UniBasic
- Page 72 and 73: ACTIVATEKEY Syntax ACTIVATEKEY , [
- Page 74 and 75: STATUS Code Example 1-80 UniBasic C
In the next example, when you compile the program segment, the system defines<br />
array1 as a 100-element array and initializes it with 1:<br />
$UNDEFINE SMALL<br />
$IFDEF SMALL<br />
PRINT 'SMALL was defined'<br />
$ELSE<br />
DIM array1(100)<br />
MAT array1 = 1<br />
$ENDIF<br />
Related <strong>Commands</strong><br />
<strong>UniBasic</strong><br />
$DEFINE, $IFNDEF<br />
$IFDEF 1-32