Results 1 to 7 of 7

Thread: Finding out how many elements are in an array in VB6

  1. #1
    inh
    inh is offline
    Maximum Bitrate
    Join Date
    Jan 2007
    Location
    Fort Riley KS
    Posts
    515

    Finding out how many elements are in an array in VB6

    Im using Split to split some text in to an array.. How do i find out how many pieces of text it split it in to though?
    cashtexts - Earn money for receiving text messaged offers
    cashtexts review not a scam
    Space Navigator - 6 Axis input device: Take it apart - Driver App
    RRCam - Video/webcam capture, text overlay, and recording: 2.0 Stable

  2. #2

  3. #3
    FLAC SFiorito's Avatar
    Join Date
    May 2004
    Posts
    1,364
    don't forget that VB6 array indexes start at 1 unless you override it (can't remember how that's done, haven't used VB6 in.....7 years?)

  4. #4
    Confusion Master
    Auto Apps:loading...
    Enforcer's Avatar
    Join Date
    Sep 2003
    Location
    If you go down to the woods today, You're sure of
    Posts
    14,585
    Quote Originally Posted by SFiorito View Post
    don't forget that VB6 array indexes start at 1 unless you override it (can't remember how that's done, haven't used VB6 in.....7 years?)
    They actually start at 0 unless otherwise specified.

    eg

    dim array()

    array=split(string,",")

    array(0) will contain the string content before the first ,

    array(1) the next and so forth

  5. #5
    FLAC SFiorito's Avatar
    Join Date
    May 2004
    Posts
    1,364
    oh ok....i was thinking the opposite then. so they can be changed to be 1-based then. nevermind! like i said, it's been a long time since i worked on vb6....

  6. #6
    Confusion Master
    Auto Apps:loading...
    Enforcer's Avatar
    Join Date
    Sep 2003
    Location
    If you go down to the woods today, You're sure of
    Posts
    14,585
    They can be set to start and end virtually anywhere (actually not tried negative numbers)

    ie

    dim Array (1 to 6)

    would force it to start at 1

  7. #7
    Newbie
    Join Date
    Sep 2007
    Location
    Denmark, Europe
    Posts
    8
    As far as I remember, specifing Option Base 1 or Option Base 0 at the beginning of class/module/form etc switched beetween 0 and 1 as base

    /Morten

Similar Threads

  1. VB6 vs VB 2005 Express
    By alimh in forum Road Runner
    Replies: 11
    Last Post: 01-28-2009, 04:43 AM
  2. UI Elements
    By dwhite in forum DigitalMods (Scripts / API)
    Replies: 3
    Last Post: 08-06-2006, 06:30 PM
  3. Need help finding a sub box ...
    By shakes in forum Car Audio
    Replies: 13
    Last Post: 05-12-2005, 12:58 PM

Bookmarks

Posting Permissions

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