Difference between revisions of "TextOutputStream.WriteLine"

From Xojo Documentation

 
Line 4: Line 4:
 
| ownertype=class
 
| ownertype=class
 
| scope=public
 
| scope=public
| parameters=Text as [[String]]
+
| parameters=data as [[String]]
 
| platform=all
 
| platform=all
 
}}
 
}}
 
{{Description
 
{{Description
|text = Writes the text passed to the '''TextOutputStream''' and appends the ''Delimiter'' to the end of the line. }}
+
|text = Writes the data passed to the '''TextOutputStream''' and appends the ''Delimiter'' to the end of the line. }}
  
 
==Notes==
 
==Notes==

Latest revision as of 19:13, 27 January 2022

Method

TextOutputStream.WriteLine(data as String)

Supported for all project types and targets.

Writes the data 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