Show/Hide Toolbars

XSharp

The -vo14 option enables VO compatible handling of floating point literal numbers

Syntax

-vo14[+|-]

Arguments

+ | - Specifying +, or just -vo14, tells the compiler treat floating point literal numbers (for example: 123.456) as FLOAT data type, instead of as REAL8 (System.Double), which is the default.

Remarks

When this option is enabled, floating point literal numbers are treated by the compiler as FLOAT values, for compatibility with existing Visual Objects code. This option is enabled by default in transported projects.

 

For new code, it is strongly recommended not to enable this compiler option, as it generates less efficient code. For example, for the following code:

 

LOCAL r := 3.0 AS REAL8
r := r * 4.5 + r + 5.5

 

if -vo14 is enabled, the compiler treats the "1.0", "1.5" and "2.5" values as numbers of type FLOAT, causing the whole calculation to be made on FLOAT values and the result is at the end converted to REAL8, before it is finally stored to the local variable. FLOAT is a special data type defined in the runtime and is significantly slower than the REAL8 (System.Decimal) data type, which maps directly to a (mathematic) processor registry. Disabling -vo14 option, would cause the above code to execute faster by a large factor.

 

Note that by using the "d" or "s" suffix, as in 123.456d and 123.456s, the REAL8 or REAL4 data type is being enforced on a literal number, no matter if -vo14 is enabled or disabled. See Literals for more information.

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