Defined()

PreprocessorSolely a Preprocessor function

Checks if a symbol or constant is defined. The Preprocessor functions are for #if..#endif-Structures and allow conditional compiling of program code dependent on the existance of a symbol. Defined() is similar to the #ifdef-Directive in C as a function. Valid are:

  • Constants, also controller constants like avr.TIMSK
  • Labels from assembler source
  • Library names e.g. Graphics.interface

Syntax:

  • defined( symbol )
    The result is true, if symbol is defined.

See also: Directives, Compile process

Luna

#if defined(avr.TIMSK0)
  'more
#endif
#if defined(Graphics.interface)
  'more
#endif
#if defined(mylabel)
  'more
#endif

Assembler

.if defined(avr.TIMSK0)
  'more
.endif
.if defined(Graphics.interface)
  'more
.endif
.if defined(mylabel)
  'more
.endif