a tip for newbies (like me)
BCE
mark at bcesouth.com
Wed Mar 20 04:33:00 EST 2002
I keep forgetting this each time I try it, so I thought I might save someone
else the time of wondering what in the world is happening if they try this
too. And maybe I'll remember it if I wirte it down!
The goal:
Ask a user for a text file, then put the contents into a field. Simple
enough.
The WRONG method:
on mouseup
ask file "What file?"
put "file:" & it into field "myField"
end mouseup
The RIGHT method: (at least for me, on windows)
on mouseup
ask file "What file?"
put ("file:" & it) into field "myField"
end mouseup
Notice the parentheses in the second line --- they make the difference.
Otherwise, just the name of the file is put into the field, and not the
contents, and a lot of hair pulling occurs. Apparently if you're
concantenating a variable and some text into the name of a file, this needs
to be done.
Hope that helps some folks out. Later!
Mark Paris
More information about the use-livecode
mailing list