TextOutputStream.WriteLine

From Xojo Documentation

Revision as of 19:32, 21 January 2022 by Gperlman (talk | contribs)
You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!
Method

TextOutputStream.WriteLine(Text as String)

Supported for all project types and targets.

Writes the text passed to the TextOutputStream and appends the Delimiter to the end of the line.

Notes

If WriteLine fails, an IOException will be raised.

Sample Code

This example displays the Save As dialog box. A text file is then created and the text properties of three TextFields are written to the new file. Finally the file is closed.

Var file As FolderItem = FolderItem.ShowSaveFileDialog(FileTypes1.Text, "MyInfo.txt")
If file <> Nil Then
Var output As TextOutputStream
output = TextOutputStream.Create(file)
output.WriteLine(NameField.Value)
output.WriteLine(AddressField.Value)
output.WriteLine(PhoneField.Value)
output.Close
End If