Read from file, then display results

Mark Brownell gizmotron at earthlink.net
Thu Jul 8 01:20:40 EDT 2004


on 7/7/04 9:57 PM, Marian Petrides at mpetrides at earthlink.net wrote:
>> on mouseUp
>> global gFilePath
>> answer file "select a file"
>> if it contains ".txt" then
>> put URL ("file:" & it) into AddListContents
>> put it into gFilePath
>> else
>> answer " Not a text file"
>> exit mouseUp
>> end if
>> end mouseUp
> Your second example appears, instead, to be an example of how to WRITE
> to a file. Or am I simply befuddled at this late hour (nearly 1 AM, my
> time)??
> 
> M

This part is an open file handler that is different from write to or read
from methods. I just added the save method for the heck of it using a global
variable to save to the gFilePath without opening a file selection window
first. Just showing you stuff... look at "answer file" and "ask file" in the
docs.

Mark



More information about the use-livecode mailing list