Pragma | Description |
---|---|
Ansi2Oem | Converts literal character strings to OEM |
AutoMemvar | Declares PRIVATE and PUBLIC variables as MEMVAR |
DynamicMemvar | Treats undeclared variables as MEMVAR |
Info | Toggles the display of all or particular warnings |
Library | Declares LIB files for the linker |
LineNumber | Toggles creation of line numbers |
Map | Maps function symbols to another symbol |
Oem2Ansi | Converts literal character strings to ANSI |
Shortcut | Toggles logical short-cut optimization |
Directive #pragma Foundation
Activates or deactivates compiler switches during compile time
#pragma <PragmaName>( <Option> )
A pragma is a directive that changes a compile switch while the compiler translates source code. This allows compiler switches for a single line of code in a PRG file to be set or suspended.
Ansi2Oem
The pragma Ansi2Oem(ON|OFF) toggles the compiler switch /go which causes the compiler to convert literal character strings in the source code to the OEM character set.
AutoMemvar
AutoMemvar(ON|OFF) toggles the compiler switch /a, which declares all dynamic memory variables as MEMVAR (PRIVATE, PUBLIC or PARAMETERS).
DynamicMemvar
DynamicMemvar(ON|OFF) toggles the compiler switch /v, which treats all undeclared variables as MEMVAR.
Info
The pragma Info() enables or disables all or particular warnings of the compiler. Instead of the options ON|OFF, key word pairs are used to toggle particular warnings. They are listed in the following table:
Option | Enables | disables warning... |
---|---|
ALL | NONE | All warnings |
DYN | NODYN | Warnings that are displayed with the /w switch (usage of undeclared dynamic variables) |
LEX | NOLEX | Warnings that are displayed with the /wl switch (usage of non lexical variables) |
INIT| NOINIT | Warnings that are displayed with the /wi switch (variable is not initialized) |
USE | NOUSE | Warnings that are displayed with the /wu switch (unused lexical variables) |
RESTORE | Restores the last Info() setting |
Library
Either the option NONE is indicated for the Library() pragma, or a comma-separated list of libraries (LIB files) must be specified. The file names of the libraries must be enclosed in quotes. Option NONE works like the compiler switch /nod (No default library). If file names are listed, this is equal to the compiler switch /r. Therefore, libraries can be defined for the linker in a PRG file.
LineNumber
LineNumber(ON|OFF) toggles creation of line numbers. The default is ON. Specifying OFF is equal to the compiler switch /l.
Map()
This #pragma is usually only required when function developed using the C-API are called in an Xbase++ program. It is used in the following way:
This causes the compiler to replace the symbol <oldSymbol> of function/procedure calls and declarations with <newSymbol>, so that <oldSymbol> does not exist in the resulting OBJ file. Note that <newSymbol> must be enclosed in quotes.
Oem2Ansi
The pragma Oem2Ansi(ON|OFF) toggles the compiler switch /ga which causes the compiler to convert literal character strings in the source code to the ANSI character set.
Shortcut
Shortcut(ON|OFF) toggles the compiler switch /z, which activates or deactivates short-cut optimization of combined logical expressions.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.