VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Writes a text file to c: and saves two lines of text, then loads them back up. You can add as many

by VisualScope (20 Submissions)
Category: Files/File Controls/Input/Output
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sun 28th May 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Writes a text file to c: and saves two lines of text, then loads them back up. You can add as many lines as you like and change the text.

Rate Writes a text file to c: and saves two lines of text, then loads them back up. You can add as many



Dim x As String
Dim y As String

Private Sub Command1_Click()
Open "c:/text.txt" For Input As #1
    Line Input #1, x
    Line Input #1, y
    Close #1
    Text1.Text = x
    Text2.Text = y
End Sub

Private Sub Form_Load()
 Open "c:/text.txt" For Output As #1
    Print #1, "your first line of text"
    Print #1, "your second line of text"
    Close #1
End Sub

Download this snippet    Add to My Saved Code

Writes a text file to c: and saves two lines of text, then loads them back up. You can add as many Comments

No comments have been posted about Writes a text file to c: and saves two lines of text, then loads them back up. You can add as many . Why not be the first to post a comment about Writes a text file to c: and saves two lines of text, then loads them back up. You can add as many .

Post your comment

Subject:
Message:
0/1000 characters