Xojo.IO.TextOutputStream.Append
From Xojo Documentation
Shared Method
Xojo.IO.TextOutputStream.Append(f As Xojo.IO.FolderItem, encoding As Xojo.Core.TextEncoding) As Xojo.IO.TextOutputStream
Supported for all project types and targets.
Supported for all project types and targets.
Opens the passed file so that text can be appended to existing text.
Exceptions
- IOException for these conditions:
- file does not exist
- file is not writeable
- containing folder is not writeable
- the FolderItem is Nil
- a system I/O error occurs
Sample Code
Using Xojo.Core
Using Xojo.IO
Var f As FolderItem
f = SpecialFolder.Documents.Child("SaveData.txt")
Var output As TextOutputStream
Try
output = TextOutputStream.Append(f, TextEncoding.UTF8)
output.WriteLine("This text is appended to the end of the file.")
output.Close
Catch e As IOException
Label1.Value = "Unable to append to file."
End Try
Using Xojo.IO
Var f As FolderItem
f = SpecialFolder.Documents.Child("SaveData.txt")
Var output As TextOutputStream
Try
output = TextOutputStream.Append(f, TextEncoding.UTF8)
output.WriteLine("This text is appended to the end of the file.")
output.Close
Catch e As IOException
Label1.Value = "Unable to append to file."
End Try