Show/Hide Toolbars

XSharp

The following defines can be used in your code and will be replaced by the compiler with a literal value:

Name

Type

Value

__ARRAYBASE__

Integer

0 or 1 depending on the /az compiler option

__CLR2__

String Literal

__CLR2__ (only for compatibility with Vulcan, x# does not implement the /clr compiler option). See comment below.

__CLR4__

String Literal

__CLR4__ (only for compatibility with Vulcan, x# does not implement the /clr compiler option). See comment below.

__CLRVERSION__

String Literal

"2" or "4"depending on the version. (only for compatibility with Vulcan, x# does not implement the /clr compiler option). See comment below.

__DATE__

String Literal

Current date in YYYYMMDD format

__DATETIME__

String Literal

Current date/time in format from regional settings

__DIALECT__

String

Name of the current dialect

__DIALECT_CORE__

Logical

Defined with TRUE when Core dialect is selected

__DIALECT_FOXPRO__

Logical

Defined with TRUE when FoxPro dialect is selected

__DIALECT_HARBOUR__

Logical

Defined with TRUE when Harbour dialect is selected

__DIALECT_VO__

Logical

Defined with TRUE when VO dialect is selected

__DIALECT_VULCAN__

Logical

Defined with TRUE when Vulcan dialect is selected

__DIALECT_XBASEPP__

Logical

Defined with TRUE when Xbase++ dialect is selected

__DEBUG__

Logical Literal

TRUE when compiling in debug mode. Undefined in Release mode

__ENTITY__

String Literal

Name of current entity

__FILE__

String Literal

Current source file name

__FOX2__

Logical

Current value of the FoxPro compatibility compiler option /fox2

__FUNCTION__

String Literal

Current function/method name without class prefix and in original case

__FUNCTIONS__

String Literal

Returns the name of the current Functions class

__HARBOUR__

Logic literal

TRUE when the Harbour dialect is selected. Otherwise not defined.

__LINE__

String Literal

Current source line number

__MEMVAR__

Logical

TRUE when the /memvar compiler option is used

__MODULE__

String Literal

Current source file name

__SIG__

String Literal

Signature of current entity

__SRCLOC__

String Literal

Filename and line number in the source

__SYSDIR__

String Literal

Systemdir (on developers machine!)

__TIME__

String Literal

Compile time in HH:mm:ss format

__UNDECLARED__

Logical Literal

TRUE when the /undeclared compiler option is used

__UNSAFE__

Logical Literal

TRUE when the /unsafe compiler option is used

__UTCTIME__

String Literal

UTC Compile time in HH:mm:ss format

__VERSION__

String Literal

Version of the compiler

__VO__

Logic literal

TRUE when the VO dialect is selected. Otherwise not defined.

__VO1__ , __VO2__ ... __VO17__

Logical

Current value of the matching VO compatibility compiler option, /vo1, /vo2 ... /vo17

__VULCAN__

Logic literal

TRUE when the Vulcan dialect is selected. Otherwise not defined.

__WINDIR__

String Literal

Windows dir (on developers machine!)

__WINDRIVE__

String Literal

Windows drive (on developers machine!)

__XPP__

Logic literal

TRUE when the Xbase++ dialect is selected. Otherwise not defined.

__XPP1__

Logical

Current value of the /xpp1 compiler option. Only defined in the Xbase++ dialect.

__XSHARP__

Logical Literal

Always TRUE

__XSHARP_RT__

Logical Literal

TRUE when compiling against the X# runtime. Not defined otherwise.

Note

The CLR2 and CLR4 version is determined by the X# compiler by looking at the version of either system.dll or mscorlib.dll