I want to read a file, which i don't know the lenght of.
shouldn't that be something like this:
dim temp2(99) as string
temp = freefile
open "whatever.txt" for input as temp
do while eof(temp)
input temp, temp2(i)
i = i +1
loop
Printable View
I want to read a file, which i don't know the lenght of.
shouldn't that be something like this:
dim temp2(99) as string
temp = freefile
open "whatever.txt" for input as temp
do while eof(temp)
input temp, temp2(i)
i = i +1
loop
Code:I want to read a file, which i don't know the lenght of.
shouldn't that be something like this:
dim temp2(99) as string
temp = freefile
i=1
open "whatever.txt" for input as temp
do while NOT eof(temp)
input temp, temp2(i)
i = i +1
loop
input temp, temp2(i) doesn't work.
it says "Expected #"
then add themQuote:
Originally posted by jim mcnamara
Code:I want to read a file, which i don't know the lenght of.
shouldn't that be something like this:
dim temp2(99) as string
temp = freefile
i=1
open "whatever.txt" for input as #temp
do while NOT eof(temp)
input #temp, temp2(i)
i = i +1
loop
k, its working now, thanks!
anytime
Always hoping, of course, that the file has less than 100 lines in it, otherwise consider using redim????Quote:
Originally posted by eXterminator
I want to read a file, which i don't know the lenght of.
shouldn't that be something like this:
dim temp2(99) as string
temp = freefile
open "whatever.txt" for input as temp
do while eof(temp)
input temp, temp2(i)
i = i +1
loop
Pigmy
:cool:
:D I know, that was just an example. It read code looks a bit different.
Argh,!!! my mean "The real code look a bit different" :D
fairly goof proof way to read a text file into an array
The number of array elements is Ubound(str)Code:Dim str() as string
Dim tmp as String
Open "myfile" for input as #1
tmp = input(LOF(1),1)
str=Split(tmp,vbCrLf)