01-15-2013 10:19 AM
Hello,
I got a character chain coming from an editbox
For exemple, the user put 12,4 or jaimelepate in the editbox
It return me the value "12,4" or "jaime lepate" (text form)
I want to check if the value is a text or a real number, then transform it into a real (I think this is done by Val("myvalue")
How may I check the type of value?
Thanks for your help
Best regards,
Fred
Solved! Go to Solution.
01-16-2013 01:11 PM
Hi Fred,
You can check with IsNumeric(InputValue).
Brad Turpin
DIAdem Product Support Engineer
National Instruments
01-17-2013 04:34 AM
Hi,
The following example checks whether a variable is a number:
Dim MyVar
MyVar = 4711
Call MsgBox(IsNumeric(MyVar)) ' Returns True
MyVar = "4711"
Call MsgBox(IsNumeric(MyVar)) ' Returns True
MyVar = "No.4711"
Call MsgBox(IsNumeric(MyVar)) ' Returns False
Use <F1> to call the Help file of the method " IsNumeric " for VBS.
01-17-2013 06:14 AM
Hello
Thanks I did it this way:
If(IsNumeric(Begin_Correlation_Time)) Then Begin_Correlation_Time = Val(Begin_Correlation_Time) else Dialog_Box_Diagnostic_array(6) = "please select numeric values for correlation time" end if End Sub
Best Regards,
Fred