DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Find number in a character chain

Solved!
Go to solution

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

 

 

0 Kudos
Message 1 of 4
(5,062 Views)
Solution
Accepted by topic author fmanuel

Hi Fred,

 

You can check with IsNumeric(InputValue).

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 2 of 4
(5,045 Views)

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.

0 Kudos
Message 3 of 4
(5,034 Views)

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

0 Kudos
Message 4 of 4
(5,024 Views)