Well, as you all have speculated, my (secondary) problem was with the EOL character.
I have a text file on the Mac which has lines separated by carriage returns. I originally brought this information into Xojo with
[quote] Const NAME_DATA_FILE = “TA_Data.txt”
Dim tisTA_Data As Xojo.IO.TextInputStream
Dim cxj_fiTA_Data As New FolderItem(GetFolderItem(NAME_DATA_FILE)) // will look in the folder with the app
Dim fiTA_Data As New Xojo.IO.FolderItem(cxj_fiTA_Data.NativePath.ToText) // Convert to Xojo.IO folderItem (cxj → classic Xojo)
If fiTA_Data <> Nil Then
If fiTA_Data.Exists Then
tisTA_Data = Xojo.IO.TextInputStream.Open(fiTA_Data, Xojo.Core.TextEncoding.UTF8)
Self.xInfo = tisTA_Data.ReadAll
tisTA_Data.Close
End If
End If[/quote]
So the contents of the text file on disk, ended up in the text property of the window: Self.xInfo
CR in my app is a constant equal to Chr(13) or &u0d – i.e. the return character. The following line of code “worked”
* * * * * * * * * * * *
Then I tried an alternative approach. In the IDE, I simply pasted the text file into a Constant (Self.TA_INFO)
In the code, the loading of the information from the disk into Self.xInfo seen above was replaced by simply assigning the Self.xInfo property.
At this point
would no longer work properly. The reason was that apparently pasting the text into the Constant resulted in all the carriage returns – &u0d – being replaced by line feeds – &u0a –
works just fine.
Probably for clarity, if nothing else, I will adapt the equivalent of the Palardy suggestion
* * * * * * * * * * * *
But for me, it was somewhat curious that pasting the original text file full of carriage returns into the Constant resulted in those carriage returns being converted into linefeeds.
Once you are aware that this happens, it is easy to deal with.