Results 1 to 3 of 3

Thread: how to compare a type ?

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2003
    Posts
    2

    Question how to compare a type ?

    function seek_type(var)

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

    thanks a lot

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    You can use gettype to get the type of the object or TypeOf to make a comparison.
    VB Code:
    1. Dim var As String = "hi"
    2.         If TypeOf var Is String Then
    3.             MsgBox("TypeOf worked")
    4.         End If
    5.  
    6.         If var.GetType Is GetType(String) Then
    7.             MsgBox("GetType worked")
    8.         End If

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2003
    Posts
    2

    you are my half god

    thank you a lot

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width