VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Saves text to a .ini or .dat or whichever extention you would like it to

by oxy (2 Submissions)
Category: Files/File Controls/Input/Output
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 29th March 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Saves text to a .ini or .dat or whichever extention you would like it to

Rate Saves text to a .ini or .dat or whichever extention you would like it to



'if you would like to save under a different file extention (here it's .dat)
'just change the extention in the code.

Private Sub LoadTextFromFile(Textb as String)
On Error GoTo Error
Open "c:\visualbasic.dat" For Output As #1
Write #1, Textb
Close #1
End Sub

Private Sub SaveTextToFile(Textb as String)
On Error GoTo Error
Open "c:\visualbasic.dat" For Input As #1
Input #1, lineoftext$
Textb = lineoftext$
Close #1
End Sub

Error:
Msgbox "There has been an error!", VbOkOnly, "Oops!"
End Sub

Download this snippet    Add to My Saved Code

Saves text to a .ini or .dat or whichever extention you would like it to Comments

No comments have been posted about Saves text to a .ini or .dat or whichever extention you would like it to. Why not be the first to post a comment about Saves text to a .ini or .dat or whichever extention you would like it to.

Post your comment

Subject:
Message:
0/1000 characters