Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IsNumeric - VFP analogue?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00307922
Message ID:
00307944
Views:
49
George,

IsDigit() checks only first symbol, so it's not suitable for my situation. Type() works fine.

Example:

myNumber='12345'
type(myNumber)='N'
isDigit(myNumber)=.t.

myNumber='1hffhhf'
type(myNumber)='U'
isdigit(myNumber)=.t.


>>>
>>>You can use the funcion TYPE.
>>>Example:
>>>
>>>IF TYPE(mynumber) = "N"
>>> WAIT WINDOW "IT'S A NUMBER!!!"
>>>ELSE
>>> WAIT WINDOW "IT'S SOMETHING ELSE!"
>>>ENDIF
>>>
>>>
>>>Cheers,
>>>
>>>Ricardo
>> Has this changed from VfP 5 - parameter to TYPE had to be a character expression, ie. TYPE( "mynumber" ) ?
>
>In VFP 6.0, there's VARTYPE() which takes the variable, and TYPE() which takes a character expression of a variable.
>
>I'm not entirely sure, however, if this is exactly what the question pertains to. If you're trying to determine if a string character is a number or something else, there' ISDIGIT()
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