Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How does one determine if a value is a true INTEGER?
Message
From
20/10/2000 06:41:04
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
20/10/2000 06:05:39
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00431993
Message ID:
00431995
Views:
20
>Here´s the scenario:
>
>Reading a CSV/TXT file, I receive "1000","2.541","2000","2000.00"
>
>The rule says if the value of the string is a true integer (2000), divide it by 100, otherwise (2000.00) leave it as it is.
>
>Since VFP evaluates 1=1.000 to true, a simple ? INT(VAL(lcValue))=VAL(lcValue) is not very helpful.
>
>I´ve come up with
>
>lnValue=IIF("." $ lcValue,VAL(lcValue),VAL(lcValue)/100)
>
>Which works, of course, except it´s sooo sloooow!
>
>If there is a better (much much faster) way please let me know!
>
>TIA

IMHO any inline evaluation would be slow, ie:
lcValue # transform(val(lcValue)) && 2000.00
I would get contents into a temporary cursor as char type and have an extra field as numeric. After append I would populate numeric field with a replace all.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform