S
Seth
Hi,
I am trying to use the Input function to read the
contents of a text file into a variable. The text file
is very large, and I keep getting the same message
everytime I try to run code that I know works on other
text files (they are smaller):
"Input past end of file"
Here is the code:
____________________________________________
FF = FreeFile ' get the next free file in line
Open SourceFile For Input As FF ' Opens the text file
stream
lChars = LOF(FF) ' lChars is a LONG varaible
AllText = Input(lChars, FF) ' Loads the textfile into
the AllText variable (AllText is a string variable and i
tried Variant too with the same result)
Close FF
_______________________________________________
The number of characters in the text file is 2,685,277.
When the code is executed i get "Input past end of file".
If I force the number of characters to a lower number, it
all works fine.
Any thoughts on what is going on, and if there is a
workaround?
Thanks,
Seth
I am trying to use the Input function to read the
contents of a text file into a variable. The text file
is very large, and I keep getting the same message
everytime I try to run code that I know works on other
text files (they are smaller):
"Input past end of file"
Here is the code:
____________________________________________
FF = FreeFile ' get the next free file in line
Open SourceFile For Input As FF ' Opens the text file
stream
lChars = LOF(FF) ' lChars is a LONG varaible
AllText = Input(lChars, FF) ' Loads the textfile into
the AllText variable (AllText is a string variable and i
tried Variant too with the same result)
Close FF
_______________________________________________
The number of characters in the text file is 2,685,277.
When the code is executed i get "Input past end of file".
If I force the number of characters to a lower number, it
all works fine.
Any thoughts on what is going on, and if there is a
workaround?
Thanks,
Seth