/* * $Id$ */ INTRODUCTION ============ This file explains what is and how to use the #pragma directive with Harbour. Primarily, it gives you control over the compiler's command-line switches within your source code. WHAT IS ======= The #pragma is a directive used inside the source code in many compilers to change the behavior of the compiler at compile time. USAGE ===== Currently the #pragma directive can be used in two ways: the switch mode and the command mode. The syntax is: #pragma [=On/Off] or #pragma -CompilerFlag[+|-] You can use both modes mixed in the same module and upper/lower case without worry. To enable or disable a command or a switch you simply do: * Command mode Switch mode -------------------------------------------------------------- * #pragma =On/Off #pragma /+/- Example: #pragma AddDebugInfo=Off /* Suppress debug info */ #pragma /B+ /* Add debug info from here */ IMPLEMENTATION ============== This is the list of the supported commands and switches: * Command Switch ----------------------------------------------- * AUTOMEMVARS = /A<+/-> * DEBUGINFO = /B<+/-> * ENABLEWARNINGS = /W<+/-> * EXITSEVERITY = /E * FORCEMEMVARS = /V<+/-> * LINEINFO = /L<+/-> * NOSTARTPROC = /N<+/-> * PREPROCESSING = /P<+/-> * WARNINGLEVEL = /W * SHORTCUTTING = /Z<+/-> The switches have the same behavior as the corresponding compiler ones and the commands are synonyms for the switches. * TRACEPRAGMAS This command shows pragma activity at compile time when enabled. NOTE: You can use the abbreviated command mode by typing only the first eight chars. NOTES ===== This directive is not supported in the standalone version of the Harbour preprocessor. EXAMPLES ======== #pragma NoStartProc=Off /* #pragma /N- */ function Test() return nil This is the same as calling Harbour with the -n switch in the command line, but with the great benefit that if you forgot to pass the switch, it will be used anyway because it is included inside the source. =========== Dec 1, 1999 Regards, Jose Lalin