Results 1 to 12 of 12

Thread: Split Function

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833

    c = "1,2,3,4,5,6"
    a = Split(c, ",")


    how do i know that my "a" array has 6 items in it

    a.ubound

    gives me an error

    Should Declare Anything specially?
    Kurt Simons
    [I know I'm a hack but my clients don't!]

  2. #2
    Hyperactive Member
    Join Date
    May 2000
    Posts
    367
    does that work? taking the split of an array? let me try that first then try to help.

    what are you trying to do here? take a string and assign it to an array?

    [Edited by billrogers on 07-31-2000 at 09:09 AM]

  3. #3
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    Ubound is a function in itself, not a method of an array.

    Code:
    Msgbox UBound(myArray)
    Iain, thats with an i by the way!

  4. #4
    Hyperactive Member
    Join Date
    May 2000
    Posts
    367
    yes, but what is it he is attempting to do here?

    I believe he wants to take a string and try to assign it to an array, then get the ubound of that array.

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    Oops...

    Let me delete this before anyone sees!


    c = "1,2,3,4,5,6"
    a = Split(c, ",")


    for b = 0 to ubound(a)
    debug.print a(b)
    next b


    Thanks
    Alot
    Kurt Simons
    [I know I'm a hack but my clients don't!]

  6. #6
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    Bill.

    This is my guess.

    Code:
    Dim c as String
    Dim a() as String
    
    c = "1,2,3,4,5"
    a = Split(c,",")
    Iain, thats with an i by the way!

  7. #7
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    OK you just delted that post, so mine now makes no sense.
    Iain, thats with an i by the way!

  8. #8
    Fanatic Member
    Join Date
    Apr 2000
    Location
    Whats a location?
    Posts
    516
    Don't worry Iain. That imaginary friend of yours will stop banging on the radiators during the night if you spend a few hours a week talking to somebody who can help you through this difficult, and no doubt stressful, time.

    And while the shrink <ahem> psycho-emotional councillor deals with your problem(s), I would go easy on the hallucinogenic drugs. And the drink. And the smoking. And the gambling. And the women. Maybe not the women.

    Together, you and your psycho-emotional councillor will be able to cure you from this vicious circle of drugs, lies, and programming.

    You can save a life. Your own.

    Courgettes.

  9. #9
    Hyperactive Member
    Join Date
    May 2000
    Posts
    367
    sorry iain, i figured it out.

  10. #10
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    ROFL
    Harry.

    "From one thing, know ten thousand things."

  11. #11
    Guest
    "I'm fairly distressed here!", Dr. Iam Malcolm
    Jurassic Park

    I just thought it seemed appropriate here, "a.ubound" good heavens above!

  12. #12
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    10 years after the fact....

    'zerobase + 1 gives the number of items
    MsgBox UBound(a) + 1
    'to print it's
    Dim i
    For i = LBound(a) to UBound(a)
    debug.print a(i)
    Next

    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

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