G giagia Member Licensed User Jul 30, 2020 #1 How do I write on a text file and add the line at the end file? If I Use File.WriteString, will be the file reset ?
How do I write on a text file and add the line at the end file? If I Use File.WriteString, will be the file reset ?
Erel B4X founder Staff member Licensed User Longtime User Jul 30, 2020 #2 giagia said: If I Use File.WriteString, will be the file reset ? Click to expand... Yes. Two options: 1. Read the file with File.ReadString, add the new line and write it back. 2. Open an OutputStream with File.OpenOutput in append mode and write to this stream. Upvote 0
giagia said: If I Use File.WriteString, will be the file reset ? Click to expand... Yes. Two options: 1. Read the file with File.ReadString, add the new line and write it back. 2. Open an OutputStream with File.OpenOutput in append mode and write to this stream.
G giagia Member Licensed User Jul 30, 2020 #3 Erel said: Yes. Two options: 1. Read the file with File.ReadString, add the new line and write it back. 2. Open an OutputStream with File.OpenOutput in append mode and write to this stream. Click to expand... Can you write me a small example of code? Upvote 0
Erel said: Yes. Two options: 1. Read the file with File.ReadString, add the new line and write it back. 2. Open an OutputStream with File.OpenOutput in append mode and write to this stream. Click to expand... Can you write me a small example of code?
Erel B4X founder Staff member Licensed User Longtime User Jul 30, 2020 #4 Code: Copy Dim s As String = File.ReadString(...) s = s & CRLF & "new line" File.WriteString(...) Upvote 0
G giagia Member Licensed User Jul 30, 2020 #5 Erel said: Code: Copy Dim s As String = File.ReadString(...) s = s & CRLF & "new line" File.WriteString(...) Click to expand... thank you !? Upvote 0
Erel said: Code: Copy Dim s As String = File.ReadString(...) s = s & CRLF & "new line" File.WriteString(...) Click to expand... thank you !?