Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Found another bug
Message
From
05/07/2001 04:14:47
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00526700
Message ID:
00526848
Views:
15
But that's just my point...
why is the $ included in that list?
I expect the VAL function to always return numeric.. but if I put a $ in front of the string it suddenly returns Currency

In my case I have a variable which I am reading from a .ini file
lnRefresh = Val(GetIniStr("Refresh", "c:\temp\fred.ini"))
Set refresh to (lnRefresh)
I know that GetIniStr always returns a String, but in this case it was returning a string with a $ symbol at the front (file corruption I think).

Of course I can work around this but I just found it irritating that the Val function does not work as described in help (or Hackers guide).

Regards
Will

>Hi!
>
>val() function do not recognize the currency symbol(s) before number. Any character except number, +- and $ are considered as wring character so zero returned. If you want it recognize currency symbol(s) and return th Y type in such case, use something like following:
>
>? val(STRTRAN("£123.23",SET("currency"),"$"))
Will Jones
Previous
Reply
Map
View

Click here to load this message in the networking platform