|
-
Jun 12th, 2002, 03:02 AM
#1
Thread Starter
PowerPoster
you have to ReDim the array to whatever size you need.
Redim myArr(3)
-
Jun 12th, 2002, 03:02 AM
#2
Not NoteMe
You need to use ReDim (with Preserve to keep the old contents) first.
VB Code:
Redim Preserve array(1 to 10)
The difference between this and Dim array(1 to 10) is that you can easily make this array bigger.
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts. 
-
Jun 12th, 2002, 03:45 AM
#3
That's right, you need to ReDim / re-dimention the array and tell vb to add a new element before you can add the entry, this would make your code into :
Code:
Dim i as integer
dim strArray() as string
i=0
Do until i =3
Redim Preserve strArray(i)
strArray(i)="s"
i=i+1
loop
The preserve part (as mentioned above) keeps your existing element entries, normally, using the ReDim statement on it's own would clear all of the prvious entries & wip the array first!
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
|