Show/Hide Toolbars

XSharp

The -vo13 option enables VO compatible string comparisons

Syntax

-vo13[+|-]

Arguments

+ | - Specifying +, or just -vo13, tells the compiler that string comparisons are to be performed the same way as they are in VO, and in the RDDs, where the comparison depends on the SetCollation() setting.  When - is specified, or -vo13 is not specified, string comparisons in code use String.Compare()

Remarks

When this option is enabled string comparisions are compatible with VO and the RDDs, and depend on SetCollation() as follows:

 

When collation=#WINDOWS, string comparisons make use of services provided by Windows that automatically handle foreign character sets. These string comparisons are implemented with a call to CompareStringA() function in kernel32.dll.

 

When collation = #CLIPPER, comparisons are performed byte by byte, using a weight table for each char. As in VO, a different table can be selected with the SetNatDll() function.
In .Net we are using the runtime DLL for the weight tables. In the runtime the nation DLLs are not physically implemented as separate files; the weighting tables are embedded as resources inside XSharp.Core.dll.

 

When collation = #Unicode then the comparisons will be done with the normal String.Compare() routine that uses the current culture.

 

When collation = #Ordinal then the comparisons will be done with the normal String.Compare() routine using an ordinal comparison (this is the fastest)

 

When -v013 is not enabled string comparisons are performed using String.Compare(), where the comparison makes use of culture-sensitive sort rules according to the current culture selected.

 

The setting for -vo13 is registered with the runtime by the main application at startup. If you library is compiled with -vo13+ but the main app isn't, then the string comparisons called from the library will follow the same rules as the main app because the main app registers -vo13 setting with the runtime and the stringcomparison routines in the runtime now detect that the main app does not want to do VO compatible string comparisons.
We therefore recommend that 3rd party products always enable -vo13.

Compatibility Note:

When using -vo13 string comparisons involve converting unicode strings to ansi for compatibility and consequently are slower than with String.Compare().

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