View Single Post
Old 10-21-2003, 07:19 PM  
AssFairy
Confirmed User
 
Join Date: Jun 2003
Location: AssTown
Posts: 674
:tongue I need help with VB

I want to fill an array with data but there must be an easier way than this.

Dim MyArray$(7)
MyArray$(1) = "Monday"
MyArray$(2) = "Tuesday"
MyArray$(3) = "Wednesday"

What I really want is something like this.

Dim MyArray$(7)
Data "Monday","Tuesday","Wednesday" .....

then use a loop to add the data to the array.


I could store the data in a text file and read it in like this

Open "data.txt" For Input As #1
Do
x = x + 1
Input #1, a$
MyArray$(x) = a$
Loop Until EOF(1)
Close

but I want my data string to be stored within the program.

__________________
I sale lube
AssFairy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote