Show/Hide Toolbars

XSharp

The -vo11 option enables Visual Objects compatible arithmetic conversions.

Syntax

-vo11[+|-]

Arguments

+ | - Specifying +, or just -vo11, directs the compiler to emit code that performs arithmetic conversions that are compatible with Visual Objects.

To set this compiler option in the Visual Studio development environment:

 

1.Open the project's Properties page.

2.Click the Dialect tab.

3.Change the value.

4.Click here to see the property page

Example

// using default or /vo11-
FUNCTION Start() AS VOID
LOCAL f AS FLOAT
 
f := 1.6
? (INT)f // 1 (rounding towards zero)
 
f := 1.5
? (INT)f // 1 (rounding towards zero)
 
f := 2.5 // 2 (rounding towards zero)
? (INT)f
 
f := 3.5 // 3 (rounding towards zero)
? (INT)f
 
RETURN
 
// using /vo11 or /vo11+
FUNCTION Start() AS VOID
LOCAL f AS FLOAT
 
f := 1.6
? (INT)f // 2 (rounding towards closest integer)
 
f := 1.5
? (INT)f // 2 (rounding towards closest even integer)
 
f := 2.5
? (INT)f // 2 (rounding towards closest even integer)
 
f := 3.5
? (INT)f // 4 (rounding towards closest even integer)
 
RETURN