PDA

Click to See Complete Forum and Search --> : how to compare a type ?


prana
Aug 21st, 2003, 01:40 PM
function seek_type(var)

how could i do to know the type of var ?
(Integer or String or date ... etc)

thanks a lot :)

Edneeis
Aug 21st, 2003, 03:45 PM
You can use gettype to get the type of the object or TypeOf to make a comparison.

Dim var As String = "hi"
If TypeOf var Is String Then
MsgBox("TypeOf worked")
End If

If var.GetType Is GetType(String) Then
MsgBox("GetType worked")
End If

prana
Aug 21st, 2003, 04:14 PM
thank you a lot :)