The MP3car.com Store The MP3car.com Store    

Sponsored links

Go Back   MP3Car.com > Mp3Car Technical > Software & Software Development > Coders Corner

Reply
 
LinkBack Thread Tools Display Modes
Old 10-02-2007, 12:55 PM   #1
inh
Maximum Bitrate
 
Join Date: Jan 2007
Location: Fort Riley KS
Posts: 514
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?
__________________
Space Navigator - 6 Axis input device: Take it apart - Driver App
RRCam - Video/webcam capture, text overlay, and recording: 2.0 Stable
inh is offline   Reply With Quote
Advertisement
 
Advertisement
Sponsored links

Old 10-02-2007, 02:26 PM   #2
Confusion Master
 
Enforcer's Avatar
 
Join Date: Sep 2003
Location: If you go down to the woods today, You're sure of
Posts: 10,204
ubound(Array()) for upper value


and

lbound(Array()) for lowest value
Enforcer is online now   Reply With Quote
Old 10-02-2007, 08:11 PM   #3
FLAC
 
SFiorito's Avatar
 
Join Date: May 2004
Posts: 1,155
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?)
SFiorito is offline   Reply With Quote
Old 10-02-2007, 08:58 PM   #4
Confusion Master
 
Enforcer's Avatar
 
Join Date: Sep 2003
Location: If you go down to the woods today, You're sure of
Posts: 10,204
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
Enforcer is online now   Reply With Quote
Old 10-03-2007, 06:55 PM   #5
FLAC
 
SFiorito's Avatar
 
Join Date: May 2004
Posts: 1,155
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....
SFiorito is offline   Reply With Quote
Old 10-03-2007, 07:17 PM   #6
Confusion Master
 
Enforcer's Avatar
 
Join Date: Sep 2003
Location: If you go down to the woods today, You're sure of
Posts: 10,204
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
Enforcer is online now   Reply With Quote
Old 10-15-2007, 10:39 AM   #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
mobworld is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
VB6 vs VB 2005 Express alimh Road Runner 4 11-14-2006 05:36 AM
UI Elements dwhite DigitalMods (Scripts / API) 3 08-06-2006 06:30 PM
Need help finding a sub box ... shakes Car Audio 13 05-12-2005 12:58 PM


All times are GMT -5. The time now is 02:17 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Copyright © 1999 - 2008 Mp3Car.com Inc.Ad Management by RedTyger
Message Board Statistics