Results 1 to 3 of 3

Thread: Discover sub-type of variant [RESOLVED]

  1. #1

    Thread Starter
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536

    Resolved Discover sub-type of variant [RESOLVED]

    I have a subroutine with a Variant parameter called v. Inside the subrouting I want to find the sub-type of v. That is, if someone passes in a Boolean I want to do something different from if they pass in an Integer.

    If I look in the Watch window I can see that the sub-type is displayed. I just don't know how to access it from code.

    Any ideas?
    Last edited by trisuglow; Nov 3rd, 2004 at 07:26 AM.
    This world is not my home. I'm just passing through.

  2. #2
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    VB Code:
    1. Public Sub test()
    2. Dim var As Variant
    3.     var = True
    4.     MsgBox TypeName(var)
    5. End Sub
    Frans

  3. #3

    Thread Starter
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536

    Resolved

    Fantastic - exactly what I wanted.
    This world is not my home. I'm just passing through.

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