Show/Hide Toolbars

XSharp

Purpose

The #pragma options directive allow you to enable / disable certain compiler options for a range of code.

Syntax

#pragma options( "option", state )

Note: #pragma directives must appear between before the first entity or between entities and cannot appear in the middle of an entity

 

"option" can be one of the following (please note that not all compiler options can be used)

 

Option

Description

"az"

Zero based arrays

"enforceoverride"

Enforce the use of the OVERRIDE keyword

"enforceself"

Enforce SELF to access fields / properties / methods

"fovf"

Overflow checking (duplicate of "ovf")

"initlocals"

Initialize local variables

"lb"

Allow late binding

"memvars"

Allow memvars

"namedargs"

This option cannot be set with the #pragma keyword

"ovf"

Overflow checking (duplicate of "fovf")

"undeclared"

Allow undeclared variables

"vo1"

This option cannot be set with the #pragma keyword

"vo2"

Initialize string variables with empty strings

"vo3"

All instance members virtual

"vo4"

Implicit Signed / Unsigned conversions

"vo5"

Implicit Clipper Calling convention

"vo6"

Implicit pointer conversions

"vo7"

Implicit Casts and Conversions

"vo8"

This option cannot be set with the #pragma keyword

"vo9"

Allow missing return statements or missing return values

"vo10"

Compatible IIF Behavior

"vo11"

Compatible numeric conversions

"vo12"

Clipper Integer divisions

"vo13"

Compatible String Comparisons

"vo14"

Embed real constants as float

"vo15"

Allow untyped locals

"vo16"

Generate Clipper calling convention constructors

"fox1"

This option cannot be set with the #pragma keyword

"fox2"

Foxpro array syntax

"xpp1"

This option cannot be set with the #pragma keyword

 

State can be one of the following

on

off

default

 

Please note that you can also enable / disable overflow checking with BEGIN CHECKED .. END  / BEGIN UNCHECKED .. END