Skip to main content

#if

Syntax


#if expression

#endif

     or

#if (defined name)

#endif

Description


This statement directs the pre-processor to copy the contents of file between the if and the endif into the source to be compiled by the BASIC compiler, if expressionis TRUE (non-zero). 

#if (defined name) is equivalent to #ifdef, and can be used for more complex defines.

These statements may nest.

Example

\

#if someNAME == 3

#endif

#if (defined COMPILETHIS) || (defined COMPILETHAT )

#endif

Differences from other BASICs

\

  • similar function in PBASIC
  • no equivalent in Visual BASIC, but may be done with C-pre-processor

See also

\