TextInputStream.Open

From Xojo Documentation

Shared Method

Opens the passed FolderItem to be read as a text file. Returns a TextInputStream. An IO error will trigger an IOException.

Notes

This shared method replaces the deprecated FolderItem.OpenAsTextFile.

Example

Dim f As FolderItem
Dim t As TextInputStream
f = GetOpenFolderItem("text") // file type defined in File Type Sets Editor
If f <> Nil Then
t = TextInputStream.Open(f)
t.Encoding = Encodings.UTF8 //specify encoding of input stream
TextArea1.Text = t.ReadAll
t.Close
End if