Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How does one determine if a value is a true INTEGER?
Message
De
20/10/2000 06:50:09
 
 
À
20/10/2000 06:05:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00431993
Message ID:
00431998
Vues:
20
Hi Peter,

You could check each set of data and see if it contains an (.). If not then it's an integer.



>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
Benn Kjaer
MS Certified Professional - Visual Foxpro

"There is something rotten in the state of Denmark"
"Why make user-friendly programs, when there aren’t any friendly users :o)"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform