Just starting out in iOs and LiveCode

J. Landman Gay jacque at hyperactivesw.com
Thu Mar 3 23:11:39 EST 2011


On 3/3/11 8:26 PM, Gerry wrote:
> I'm embedding my own item delimiter character in the file for now
> (I'm using "\"). I then cycle through the text and grab each item one
> by one, putting them into lines of the field. It works, but there
> must be a better way.

Don't do that. Line breaks are preserved in text files so you shouldn't 
have to do anything, and also the backslash has a special meaning in 
LiveCode scripts, though in this case it probably won't interfere.

I'm not sure why you aren't seeing the line breaks in a plain text file, 
but they are definitely preserved. Internally, LiveCode translates all 
line breaks to unix line endings and then translates them back to the 
native OS when you write the file to disk. This is all done 
transparently and usually you never have to think about it.

Is there a reason you think the line endings aren't there? I've never 
seen them disappear.

>
> Is the problem with my .txt file? I save it out of a text editor with
> Unix line breaks specified, and it's stored on dropbox.

That should be fine. This is all you need to do:

   put url ("http://www.server.com/path/file.txt") into tVar

The contents of the text file should come in intact and be stored in the 
variable "tVar". If you want to check, then do this in the next line to 
see what's there:

   put the number of lines in tVar

You should see a number in the message box representing the number of 
lines in the file.

If that doesn't work, post the handler and we'll figure it out.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list