Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - #define macro constant definition http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 #define             Macro constant definition
------------------------------------------------------------------------------
 Syntax
   #define <macroname> [ <macrovalue> ]

 Arguments
   macroname is a unique symbol that identifies the macro.

   macrovalue is an optional token sequence that, if given, replaces all
   occurrences of macroname in the source text.

 Description
   The #define directive defines a macro. Macros provide a mechanism
   for compile time token replacement in the source file. A macro is an
   identifier that, when referenced elsewhere in the program, will be
   replaced or evaluated.

   When used to assign the identifier to a constant, the #define directive
   defines a macro that can be evaluated as the equivalent constant.
   When a macro is defined without a replacement value, the macro symbol
   is defined, and can be used with conditional compilation directives.

   Macro symbols are case sensitive, unless prepended with an ampersand (&)
   at the place of reference.

 Example
   #define EXAMPLE_DIRECTIV
   #include example.hdr

   #define SUSPEND
   
   #define BOX_WIDTH 32
   #define TITLE     "Warning"
   
   proc Test_850
   clear
   @ 10, ( __max_col - BOX_WIDTH ) / 2 to 15, ( __max_col + BOX_WIDTH ) / 2
   @ 10, ( __max_col - len( TITLE ) ) / 2 ?? TITLE
   @ 12, ( __max_col - BOX_WIDTH ) / 2 + 3
   __cr_first := .f.
   #ifdef SUSPEND
      wait
   #endif
   endproc

   proc main
   Test_850()
   endproc

See Also: -D

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson