12.15.1    Non-USA English B Language Support - VB Script

VB Scripts using String to number conversions in some languages require special consideration when handling numbers. (e.g. French, German and others that use commas as decimal delimiter).  

Microsoft’s VB engine is used for VB Scripts in WebAccess. Internally, Microsoft VB Scripts use periods (.) as the decimal delimiter.  Declaring a number using a comma as the decimal delimiter is handled by the Microsoft VB scripts:

 

rem In French version of Windows,

rem the following works with no error in VB Script

A = 34.6

 

rem bad expression to express a number in VB

A = 34,6

There is a problem with string to number conversions in some languages (French, German and others that use the comma as the decimal delimiter).

rem Good conversion of string to number in French

a = CDbl("34,6")

 

rem In French version of Windows,
rem the following generates an error in a VB Script

a = CDbl("34.6")

 

One workaround is to force the use of decimals and force the Scripting engine to use decimals by declaring the local to be English US with:

 

rem force using us standard for decimal delimiter in strings

b = setLocale("en-us")

a = CDbl("34.6)

rem set back to local standard (for example french)

setLocale(b)