PDA

Click to See Complete Forum and Search --> : Really easy question


Dec 29th, 1999, 01:35 AM
This may sound dumb but for some reason in vb6 my project will not open files as it did in vb5, but only opens the last line. I dont have any help files. Please send any source code to open a .txt file.

Yonatan
Dec 29th, 1999, 02:08 AM
This will open a text file and put it in a TextBox:


Dim FileNum As Byte, FileName As String
FileName = InputBox("Enter the full path of a text file to open:")
If (Len(FileName) = 0) Or (Len(Dir(FileName)) = 0) Then Exit Sub
FileNum = FreeFile
Open FileName For Input As #FileNum
Text1.Text = Input(LOF(FileNum), #FileNum)
Close #FileNum


------------------
Yonatan
Teenage Programmer
E-Mail: RZvika@netvision.net.il
ICQ: 19552879 (http://www.icq.com/19552879)
AIM: RYoni69

[This message has been edited by Yonatan (edited 12-29-1999).]