Results 1 to 4 of 4

Thread: [RESOLVED] get size of a variant

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2007
    Posts
    128

    Resolved [RESOLVED] get size of a variant

    how to get the size of a variant...

    e.g.
    VB Code:
    1. dim item as variant
    2. item=split(text1.text,",")

    i want to loop through all elements found in item and print them

    edit:

    ok i tried

    VB Code:
    1. for each s in item
    2.   msgbox s
    3. next
    it seems to work
    Last edited by lplover2k; Jan 10th, 2007 at 06:32 PM.

  2. #2
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: get size of a variant

    Declare it as a string.

    VB Code:
    1. Dim item() As string
    2.  
    3. item() = Split(Text1.text, ",")

    Then you can use UBound() to get the upper bounds of the array.

    Arrays start at 0.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2007
    Posts
    128

    Re: get size of a variant

    ok thanks

  4. #4
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: get size of a variant

    Now that we've helped you, you can help us by pulling down the Thread Tools menu and clicking the Mark Thread Resolved button which will let everyone know that you have your answer. Also if someone has been particularly helpful, or even particularly unhelpful, you have the ability to affect a their forum "reputation" by rating their post.

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