I’m trying to set the Delimiter character for the end of line to a Carriage Return. Working from the code example in the XoJo documentation, I’m getting a run time error at “fileStream.Delimiter = D” in the code snip below. If I comment that line out and let XoJo use the default, it works fine. Any ideas?
Var file As FolderItem = FolderItem.ShowSaveFileDialog(“TextTypes.Text”, FileName)
Var D as string = Chr(13)
If file <> Nil Then
Var fileStream As TextOutputStream
fileStream.Delimiter = D
fileStream = TextOutputStream.Create(file)
Isn’t filestream still NIL at that point?
1 Like
Looking at the debugger, it is showing NIL at that point. The question is, why and where should I be setting the delimiter? I followed the code example from the docs.
Set it after this line:
fileStream = TextOutputStream.Create(file)
1 Like
Yup.
The docs are incorrect/incomplete.
They incorrectly say:
Example
This example sets the Linefeed as the delimiter.
Var t As TextOutputStream
t.Delimiter = Chr(10) // linefeed
but TextOutputStream is a class, and t must be initialised before you can change its properties.
2 Likes
This worked! Thanks Javier!
1 Like