write fails
Ken Ray
kray at sonsothunder.com
Thu Aug 25 12:22:25 EDT 2005
On 8/25/05 8:41 AM, "Lynch, Jonathan" <bnz2 at cdc.gov> wrote:
> That makes sense.
>
> I have not tried it, but can one do the same thing by saying?:
>
> Put tNewText after URL tFileURL
Yes, you can, but remember that URL is both a keyword and a function, and
although it can work without parentheses for some file operations (like
"into"), it doesn't work when using "after" or "before" without using
parentheses, and can be touchy at other times.
So I think we've been "getting away" with saying:
put data into url "file:c:/my documents/test.txt"
when we really should be saying:
put data into url("file:c:/my documents/text.txt")
For example, this will fail to compile:
answer file "Get a file:"
if it <> "" then
put "hello" into url "file:"&it
end if
But this compiles fine:
answer file "Get a file:"
if it <> "" then
put "file:" & it into tFile
put "hello" into url tFile
end if
Better yet would be to use parentheses instead:
answer file "Get a file:"
if it <> "" then
put "hello" into url("file:"&it)
end if
Just my 2 cents,
Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com
More information about the use-livecode
mailing list