<<

Contents

Search

>>

 

#DEFINE

 

 

Compiler Instruction

 

 

Syntax:

#DEFINE <Compiler Variable>,<Number>

 

<Compiler Variable>

= <NUM-VARIABLE>

<Number>

= <NUMBER>

 

 

Meaning:

 #DEFINE defines a numeric compiler variable. With the compiler instruction #IF <NUM-VARIABLE> it can be tested whether a variable exists and has a value <> 0.

 

#DEFINE instructions are possible in all macros at any positions. Whether a variable is specified at the compilation of a macro depends on whether the macro in which the variable had been specified with #DEFINE has already been compiled. The order by which the macros are compiled is not always clearly apparent. Therefore the #DEFINE instructions should always be defined in the Macro before Index Open, because in every program this macro is the first one to be compiled.

 

Note: Compiler variable only apply to the current program, not to subprograms.

 

The following compiler variables are set automatically with the generation:

 

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.

 

Parameter:

Compiler Variable

Name of compiler variable

Number

Value of compiler variable

 

Sample:

#DEFINE DEMO 1

...

#IF DEMO

IF RECNUMBER(CUSTOMER) > 10

THEN ERRORMES = "In the demo version you cannot save " +

                "more than 10 data records."

ENDIF

#ENDIF

 

See also:

#IF