Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read strings from a file

Status
Not open for further replies.

tiago

Programmer
Nov 20, 2001
3
BR
I need read strings from a file (*.cls) How can i do it?
Thanks
 
Hi

You can do that in several diffent ways.
If the file is a text file and you want to read one line at a time:
-----------------------------------------------------
dim infile as byte, inline as string
infile=freefile
Open "c:\myfile.cls" for ijput as #infile
while not eof(infile)
line input #infile, inline
wend
close infile
-----------------------------------------------------
Or the entire file in one string:
-----------------------------------------------------
dim infile as byte, inline as string
infile = FreeFile
Open "c:\myfile.cls" For Binary As #infile
instring = String$(LOF(infile), 0)
Get #infile, 1, instring
Close #infile
------------------------------------------------------

Sunaj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top