$Compiler command

Purpose

Places the compiler-settings in the program file. Allows to set the compiler options per file.

Syntax

$Compiler [setting%]

Description

When used without a parameter the current compiler settings are inserted into the code. The settings value is a hexadecimal value whose bits represent the compiler settings. In addition, the line will get a comment with a specification of the compiler settings. The comment includes the following specifications:

Br:4a value from 0 to 4 representing the Branch Optimizations slider setting
BrExe:10 or 1 representing the Full branch optimization setting for the Exe, Lg32, or Gll
Mul:3a value from 0 to 3 representing the Integer Multiplication slider setting
Fp:3a bitvalue ranging from 0 to 15, each bit represents a checkbox of the FP Optimizations Settings ‘Addition’, ‘Multiplication’, ‘Division’, and ‘SinCos’
ChkArr:1a 0 or 1 indicating the setting of the ‘Check Array Bounds in IDE’ checkbox.
Bswp:0a 0 or 1 indicating the setting of the ‘Bswap for 80386’ checkbox.
Num2Str:1a 0 or 1 indicating the setting of the ‘Don’t autoconvert numeric strings to values’ checkbox.
FpWait:0a 0 or 1 indicating the setting of the ‘Report FP-errors early’ checkbox.
FpCons:0a 0 or 1 indicating the setting of the ‘Improve Consistency’ checkbox.
Trace:2a value of 0, 1, or 2. The value 0 represents Assert & Trace Level setting ‘In IDE and Gll’, value 1 represents ‘Never, except Gll’, and 2 represents ‘In IDE, Exe, Lg32, and Gll’

For a full description of what each these settings do, see The IDE Compiler Properties.

Example

$Compiler

...which, when you exit the line, will automatically be formatted into something like this:

$Compiler 0x0000A600 ' Br:0 BrExe:0 Mul:0 Fp:3 ChkArr:1 Bswp:0 Num2Str:1 FpWait:0 FpCons:0 Trace:0

Remarks

The compiler settings value can be set by hand; it is the hexadecimal representation of the CompilerOptions structure:

Type CompilerOptions

Branch As Bits 4      ' 0 .. 4

IntMul As Bits 4      ' 0 .. 3

FullExe As Bits 1     ' 0 or 1

FPOptims As Bits 4    ' 4 bits required

ArrChkIDE As Bits 1

Bswap As Bits 1

Num2Str As Bits 1

FPWait As Bits 1

FPConsistency As Bits 1

TraceLevel As Bits 2

EndType

However, it is much easier to let the IDE insert the value. To change the $Compiler settings-value open the Properties dialog box and select the Compiler tab. Then select the required compiler options and choose Ok to save the new dialog settings. Now remove the line containing the $Compiler command (or remove everything after $Compiler) and let the IDE re-create the hexadecimal value for the current settings. After saving the current compiler settings into the programtext reset the compiler options in the Compiler tab of the Propertes dialog to your defaults.

See Also

$ManifestOff, $LargeAddressAware

{Created by Sjouke Hamstra; Last updated: 11/08/2022 by James Gaite}