Line feed in text file

Are you developing an External using the LiveCode Externals SDK?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Jedidcad
Posts: 1
Joined: Fri Mar 09, 2007 11:24 am
Location: Italy
Contact:

Line feed in text file

Post by Jedidcad » Sat Jan 05, 2008 7:12 pm

Hi folks, I'm an italian customer and I apologize for non correct english language.

I have a little problem with the LF (line feed character).

I must write an application (for Mac Os and Windows) who generate a text data (such a geometrical data).
At the end of each line of the data there must be a return character, while at the beginning of each line must be a LF (line feed) character numToChar(10).
I can not enter the numToChar(10) in the my file:

open file "ATest.txt"
write numToChar(10) & space & Xdata & space & Ydata & return to file "ATest.txt"
close file "ATest.txt"

Also if I use the CRLF function, only a return char is present enter the file (not the line feed).

When I open this file with a text editor application (Text-Edit Plus), no line feed character is present.

Can you help?

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1236
Joined: Sat Apr 08, 2006 1:10 pm
Location: Zurich
Contact:

Post by BvG » Sun Jan 06, 2008 12:55 am

runrev automatically translates end of line characters (return and linefeed) into the current platform's preferred ones. to prevent that, you need to open the file for binary. (see the "open file" entry of the documentation for more details)
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

Post Reply

Return to “Building Externals”