Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The #define compiler directive defines conditions for conditional compilation. 

The syntax is as follows:

Code Block
languagejavascript
#define condition-name


Example:

Code Block
languagejavascript
#if not defined(ranonce)
  // this code will only run one time 
  // even if this source file is included more than once in a program, using pjs.include()
  number = number + 1;
#endif
#define ranonce


RPG Equivalent:

/DEFINE