End of Line being ignored

I have a file being created out of a string created in a web app. At the end of each line in the string I’ve added EndOfLine or endofline.unix on the cloud as shown in the example below.

Example:

dim sttXMLm as string
dim mFormFileName as String
dim mpFilename as String
dim fm as FolderItem
dim xmlDatam as TextOutputStream

strXMLm = "</acaBusHeader:ACABusinessHeader>" + EndOfLine _
     "<ACATransmitterManifestReqDtl>" + EndOfLine _
    "<PaymentYr>" + strCalendarYear + "</PaymentYr>" + EndOfLine _
    "<PriorYearDataInd>0</PriorYearDataInd>" + EndOfLine

mFormFileName = "1094C_Request_" + str(now) + "Z.xml"
    #if TargetXojoCloud then
      mpFileName = "/home/sites/www.example.com/Shared_Documents/" + Trim(strAppFolder) + "/Download/" + mFormFileName
    #else
      mpFileName = mFormFileName
    #Endif

    fm = GetFolderItem(mpFileName)
    
    xmlDatam = TextOutputStream.Create(fm)
    xmlDatam.Write(strXMLm)
    xmlDatam.Close

When the file is created in debug or standalone and viewed in a text editor with the end of line done correctly. </acaBusHeader:ACABusinessHeader> <ACATransmitterManifestReqDtl> <PaymentYr>2015</PaymentYr> <PriorYearDataInd>0</PriorYearDataInd>
When the file is created on the cloud and then viewed in a text editor, the EndOfLine is ignored.

</acaBusHeader:ACABusinessHeader><ACATransmitterManifestReqDtl><PaymentYr>2015</PaymentYr><PriorYearDataInd>0</PriorYearDataInd>

I do my development, debugging, and StandAlone Testing on Windows. I’ve also tried Xojo 2015R4.1 and 2016R1.1 at this point

Is this related to differences in the OS or CGI deployment or is this a bug in the IDE that needs to be reported?
If this is related to the OS or CGI deployment, what is the workaround?

Note: in this case the final file is an XML fine and an XML viewer does display the file correctly but not in a text editor.

How are you looking at the file ? Where is the text editor ? On the host, or do you download the file first ?

Also, you know that EndOfLine.Unix as well as EndOfLine on a Linux machine are chr(10) (LF), when a Windows machine will expect EndOfLine to be Chr(13)+Chr(10) (CR/LF), right ?

I’m aware of the difference in the OS differences but I would expect that the IDE would compile accordingly.

The file is created in the on the XOJO Cloud and it’s downloaded. So the text editor is local. The App itself is an automated app and has no user interaction.

[quote=265320:@Jeff Hamby]I’m aware of the difference in the OS differences but I would expect that the IDE would compile accordingly.

The file is created in the on the XOJO Cloud and it’s downloaded. So the text editor is local. The App itself is an automated app and has no user interaction.[/quote]

Since the executable is on Xojo Cloud which is Linux, the endOfLIne is LF, not CR/LF. Xojo indeed compiles according to the platform it runs on. When you run in the IDE it is using the platform’s EndOfLine, hence CR/LF for Windows.

The first thing I would do since you download the file is to look at it with an Hex editor and make sure of what exactly has been placed in the file. I bet you it contains the LF line termination.

Alternatively, try the same code with EndOfLine.Windows.

What are you opening the text file in locally ?
Maybe its not translating line endings properly (Notepad doesn’t but Wordpad does - I think I have that the right way round)

You do :slight_smile: