<<

Contents

Search

>>

 

#IF

 

 

Compiler Instruction

 

 

Syntax:

#IF [!]<NUM-VARIABLE>
      [[AND[!]<NUM-VARIABLE>]...
      [OR[!]<NUM-VARIABLE>]...]...
 ... Instructions ...
[#ELSE] ... Instructions ...
#ENDIF

 

Meaning:

Check compiler variable(s)

 

The condition #IF <NUM-VARIABLE> is wrong if the variable is not defined or if the variable has the value 0. In this case all lines of the macro before the next #ELSE or #ENDIF are ignored. 

 

The character ! means negation (NOT).

 

The following compiler variables are available in all programs:

 

GEN_JAVA

This variable is always set.

GEN_EBUS_J

This variable is always set.

GEN_JAVA_2T

This variable is set if a 2T program or a 2T applet is generated.

GEN_JAVA_APPLET

This variable is set if a 2T applet is generated.

GEN_HTML

This variable is set if a Html program is generated.

MAIN

This variable is set if a program is generated as main program.

 

Sample:

#DEFINE TEXT 0
#DEFINE DAT 1

 

#IF TEXT
FILENAME$ = "file.txt"
#ENDIF

 

#IF DAT
FILENAME$ = "file.dat"
#ENDIF

 

See also:

#DEFINE

IF