VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Save and Load text files

by PulseWave (25 Submissions)
Category: Miscellaneous
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Wed 24th February 1999
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Save and Load text files

Rate Save and Load text files



'Call LoadText (Text1,"C:\Windows\System\Saved.txt")
On Error GoTo error
Dim mystr As String
Open file For Input As #1
Do While Not EOF(1)
            Line Input #1, a$
            texto$ = texto$ + a$ + Chr$(13) + Chr$(10)
        Loop
        Lst = texto$
Close #1
Exit Sub
error:
X = MsgBox("File Not Found", vbOKOnly, "Error")
End Sub

Sub SaveText(Lst As TextBox, file As String)
'Call SaveText (Text1,"C:\Windows\System\Saved.txt")
On Error GoTo error
Dim mystr As String
Open file For Output As #1
Print #1, Lst
Close 1
Exit Sub
error:
X = MsgBox("There has been a error!", vbOKOnly, "Error")
End Sub


Download this snippet    Add to My Saved Code

Save and Load text files Comments

No comments have been posted about Save and Load text files. Why not be the first to post a comment about Save and Load text files.

Post your comment

Subject:
Message:
0/1000 characters