Property

TextOutputStream.LastErrorCode


Warning

This item was deprecated in version 2019r2. Please use IOException as a replacement.

Description

Reports the last file I/O error. Error numbers are given as original file system error codes.

Sample code

This example reports the last error code if the TextOutputStream is Nil.

Dim t As TextOutputStream
Dim f As FolderItem
 = GetSaveFolderItem(FileTypes1.Text, "TestFile.txt")
f f Is Nil Then Return

Try
  t = TextOutputStream.Create(f)
  If t <> Nil Then
    t.WriteLine(TextArea1.Text)
    t.Close
  End If
Catch e As IOException
  MsgBox("Error Code: " + Str(t.LastErrorCode))
End Try

Compatibility

All project types on all supported operating systems.