append data to an existing text file

cjolly

Member
Licensed User
Longtime User
Hi,

I need to create a file if it not exists, but if exists and so there are records that I can open and add new data (records).

Sorry for the basics of the question but I'm new with b4a and the understanding of some points is costing.

TIA
 

Theera

Expert
Licensed User
Longtime User
Dim NewLine As String
NewLine="ABC"
Dim Writer As TextWriter
If File.Exists(File.DirDefaultExternal,"File1.txt")=False Then
Writer.Initialize(File.OpenOutput(File.DirDefaultExternal,"File1.txt",True))
Writer.WriteLine(NewLine)
Writer.Close
End If
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…