|
-
Jan 24th, 2004, 03:46 PM
#1
Thread Starter
New Member
Dynamic Array Size??
I have this program due on monday and i need to know how to dynmically create an array. Also i need to know how to determine the size of the dynamic array for my "while" loop
The program reads from a space delimited text file and is suppose to count the occurrences of words in the file.
Any suggestions?
-
Jan 24th, 2004, 04:26 PM
#2
You can either use an ArrayList (easier) or simply ReDim your Array each time it needs something added to it (but make sure you use the Preserve keyword).
-
Jan 24th, 2004, 04:39 PM
#3
Addicted Member
Arrays are dynamic by default:
VB Code:
Dim arrString as string()
' or
Dim arrString() as string
' or
Dim arrString(10) as array
' then
ReDim arrString(5) as array
Dim i as integer
For i = 0 to arrString.Length
' your code
Next i
-
Jan 24th, 2004, 04:58 PM
#4
Originally posted by jwmoore2001
Arrays are dynamic by default:
Just remember this is only in VB. Most other languages, they are not.
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
|