Re: Strange behaviour of Str$
- From: "John Carlyle-Clarke" <john.cc@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 19 Aug 2005 11:07:39 +0000
"Tony Proctor" <tony_proctor@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
news:OUxFBlKpFHA.2916@xxxxxxxxxxxxxxxxxxxx:
> "John Carlyle-Clarke" <john.cc@xxxxxxxxxxxxxxxxxxxxxxx> wrote in
> message news:Xns96B76676367CCjohncceuroplacercouk@xxxxxxxxxxxxxxx
>> My application was running on an XP SP2 machine, with the
>> regional settings set to give a "." as the decimal separator.
>>
>> I went into the control panel, and changed the settings to a ","
>> decimal separator, while the app was running.
>>
>> At that point, I got an error which looks like it was caused by
>> Str$ returning a number like 2.94 as "2,94". This code runs on a
>> regular timer, and the error only occured once. It also doesn't
>> occur if you switch regions with the app shut down.
>>
>> Is this known behaviour?
>
> Str/Val both ignore the user's regional settings. They always use
> the ".". This is actually very useful if you're generating SQL/MDX
> queries with floating-point constants in, or generating
> VB/VBScript source code, or reading locale-independent decimal
> values from a file.
Yes, it was actually an SQL query generation that raised the error
that alerted me to the problem. But as I say, in this case, Str$
returned a number with a comma separator, either during or just after
a change in the regional number format settings in the control panel.
.
- References:
- Strange behaviour of Str$
- From: John Carlyle-Clarke
- Re: Strange behaviour of Str$
- From: Tony Proctor
- Strange behaviour of Str$
- Prev by Date: Re: Creating a reference to a dll on runtime
- Next by Date: Re: Strange behaviour of Str$
- Previous by thread: Re: Strange behaviour of Str$
- Next by thread: Re: Strange behaviour of Str$
- Index(es):
Relevant Pages
|