Getting text from an external file

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
keith.izatt
Posts: 14
Joined: Mon Dec 15, 2014 4:51 am

Getting text from an external file

Post by keith.izatt » Sat Apr 25, 2015 12:20 am

I have a file on an external server and when i post to it and retireive it with in my program it is not properly formatted depending on which platform I am using. If I post the file on my mac, the file reads as a single line when I retireive it and put it into a text field. When I use my PC, the text is properly formatted and shows up as it was in the initiallly. Why the difference on the two platforms. I want the text to stay as it was initially.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Getting text from an external file

Post by Mark » Sat Apr 25, 2015 10:31 am

Hi,

I assume you don't mean "formatted" but "encoded": some characters of your text, including crlf, don't show up correctly. What is the encoding of your file?

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

keith.izatt
Posts: 14
Joined: Mon Dec 15, 2014 4:51 am

Re: Getting text from an external file

Post by keith.izatt » Mon Apr 27, 2015 6:29 am

what i mean is that when i upload with my mac and retrieve the data in another stack it is all one line of text.
ie. 56 45 23 67
I have to reformat the data so that word 1 is put into line 1 etc.
When i upload with my PC and then retrieve the data in another stack it appear as I need it.
56
45
23
67

It is a lot easier if the data shows up as separate lines as it is the field that I am taking the data out of originally.
I hope this makes sense.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9842
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Getting text from an external file

Post by FourthWorld » Mon Apr 27, 2015 7:15 am

The default text mode for read/write will alter line endings to account for platform-specific differences. Try the binary form instead.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply

Return to “Internet”