write fails

Lynch, Jonathan bnz2 at cdc.gov
Thu Aug 25 12:34:00 EDT 2005


Thanks Ken!

So, you could say:

Put tMyText after URL(tFileURL)

But, would this be just as good as opening a file for append, then
adding information to that file?

Basically, does the open/append/add method load the entire file into
memory, then add the text, then write the new text back to disk? Does
the put after URL method do that?

-----Original Message-----
From: use-revolution-bounces at lists.runrev.com
[mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of Ken Ray
Sent: Thursday, August 25, 2005 12:22 PM
To: Use Revolution List
Subject: Re: write fails

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



_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list