The Compiler Directives Section

Navigation:  Appendices > Macro Language > Code Structure >

The Compiler Directives Section

Previous pageReturn to chapter overviewNext page

The Compiler Directives section at the very top of any macro before the var keyword (and also before the optional input section, if present). The keywords corresponding to compiler directives appear in bold purple color :




MAX_NUM_ITERATIONS 366 // need to loop over 1 year


 // declare some variables


 // some code

 // ...





There is no keyword at the beginning of this section (like there is for the input or var sections).

This section is optional, and even if you have it, you do not need to set values for all the compiler directives. Those for which you have not set a value will use the default value.

As always, you can insert comments anywhere; they are ignored by the compiler.

There is no equal sign "=" between each compiler directive and its value.


Compiler Directives are used to give specific directives concerning the execution of the current Macro. This section is often skipped except if your Macro needs special handling. Usually this is done to relax some of the run-time error checking performed by Q++.


For example, Q++ monitors the loops used in your code to make sure that you do not accidentally go into an infinite loop with the result that your PC freezes and you have to reboot. By default Q++ will assume that if you have gone through the same loop 50 times you are in an infinite loop. Obviously, if you are using a loop to go over all the dates of a year, you would include a compiler directive telling Q++ that looping up to 366 times is OK, for this Macro.

Topic 133200 updated on 07-Mar-2002.
Topic URL: