Reading text files

Chipp Walters chipp at
Sun Jul 11 00:55:48 CDT 2004


Try this. Create a button in your stack and put the following in it:

on mouseUp
    answer file "choose a text file to read"
    if it is empty then exit mouseUp

    answer URL("file:" & it)
end mouseUp

If there's nothing in the answer dialog box, then you've got a problem 
reading from the disk...though I doubt there is.

If the contents of the answer dialog IS the text file then you've got a 
path problem.

I always use the

put URL ("file:" & myFilePath) into tVar

method of accessing files.



David Squance wrote:

> I have a stack which needs to read text files and place the content in a
> field.  This had been working fine in the IDE with the text files and the
> stack in the same folder on my hard drive (Mac OS 10.3.4), but not as a
> standalone.  I switched to the answer file approach, and got it to work
> with the standalone, but it still doesn't read the files working from a CD.
> I want it to work from the CD so I can test the Windows version.  Is there
> some inherent reason it won't work when all the components are on a CD?
> Any suggestions gratefully received.
> Dave
> _______________________________________________
> use-revolution mailing list
> use-revolution at

More information about the use-livecode mailing list