End of line problem

Sarah Reichelt sarah.reichelt at gmail.com
Tue Oct 7 21:55:29 EDT 2008


On Wed, Oct 8, 2008 at 11:34 AM, Marty Knapp <martyknapp at comcast.net> wrote:
> I have a stack from which I create a text file that has to be uploaded to a
> server. The file can be either a tab or comma delimited file. I'm creating
> it in Rev 3.0 Studio on my iMac with 10.5.5. I'm getting an error that I've
> traced to an end-of-line problem. The file looks fine on my Mac but when I
> move it over to Windows XP and open it with Notepad it doesn't recognize my
> line endings (though Wordpad does). The file shows the little square block
> when the line end character should be, which I assume means it's a character
> it doesn't recognize. I've tried CR, CRLF and LF. If I fix the line ends in
> Notepad the file then uploads properly. I'm stumped . . .

You are being punished by the fact that each system has it's own way
of describing line feeds. Check out the docs for the return constant
for more info. When Rev reads or writes a text file, it converts
automatically, so you always get the right line endings for whatever
system produced the file. If you have to specify a particular line
ending, then you have to alter them manually, and save as a binary
file, not a text file.

To save a file for Windows (that uses CRLF), you will need something like this:

replace cr with CRLF in tData
put tData into URL ("binfile:WindowsData.txt")

HTH,
Sarah



More information about the Use-livecode mailing list