Hello everyone,
I am working on a lab. I have created a data file, Products.txt. I need to load the info from Products into an array, mProducts. How can I ccomplish that?
Any ideas or any help you could offer would be greatly appreciated. Thanks!!
Printable View
Hello everyone,
I am working on a lab. I have created a data file, Products.txt. I need to load the info from Products into an array, mProducts. How can I ccomplish that?
Any ideas or any help you could offer would be greatly appreciated. Thanks!!
get you started.
Dim myFile as string, myVar as string
myFile = "C:\Products.txt"
dim intNum as integer, i as integer
intnum = freefile
dim mProducts()
open myfile for input as intnum
while not eof(intnum)
redim preserve mProducts(i)
line input #intnum, myVar
mProducts(i) = myVar
loop
Close #intnum
'to check it out add a list box and run this
for i = lbound(mProducts) to Ubound(mProducts)
list1.additem mProducts(i)
next i
I appreciate the last reply I recieved but it did not work...
Maybe I did something wrong. Any further assistance you could offer I would really appreciate!
Thanks!