Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Choose a most effective approach
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00530049
Message ID:
00530200
Views:
25
>>Hi everyone,
>>
>>I have a simple problem, but I want to solve it the best way, because I want to use it in a long scan loop. I have fields in a table called Low and High (8 char). I want to translate them into numbers. Val function would not give me correct results, if these fields contain non digit info. I'm not absolutely sure, how should I treat fields with non-digit chars in them.
>>
>>Suppose, I want to treat them as 0. What would you suggest?
>>
>>Thanks in advance.
>
>Give this a try ...
>
>
>IF TRANSFORM(VAL(cLowValue)) == ALLTRIM(cLowValue)
>  nLowValue = VAL(cLowValue)
>ELSE
>  nLowValue = 0 && or skip them or do whatever else you want to do with non-numeric data
>ENDIF
>
>
>Cathy

Thanks, Cathy. This seems to be the best idea.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform