|
-
Oct 8th, 2003, 12:55 PM
#1
Thread Starter
Addicted Member
Arrays :(
hi,
i want an array , i dont know how many objects are going to be added to it before the function call, so is there anyway to
* increase the upperbound, then add the new object?
or
* i know i'm not going to have more than 20 objects, so can intsiate it with 20 objects, then remove the extra one ( empty values) at the end?
what i finally want is a full array, no empty values
thanks...
-
Oct 8th, 2003, 01:01 PM
#2
you can use the ArrayList rather than making a string type of array, eg:
VB Code:
Dim myArray As New ArrayList() '/// you can also specify a capacity in the brackets.
myArray.Add("an item added to the arraylist")
MessageBox.Show("the array now holds: " & myArray.Count)
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Oct 8th, 2003, 01:20 PM
#3
I agree with dynamic_sysop and if you need a type safe array from the arraylist you can use the ToArray method to get one.
-
Oct 8th, 2003, 01:21 PM
#4
Thread Starter
Addicted Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|