kwote

Sarah Reichelt sarah.reichelt at gmail.com
Fri Nov 11 17:29:50 EST 2005


> Actually, ( this is Dans fault :) - I am curious - do you use "kwote
> ()" as well - or are you just being nice to me :)  If so can you
> remember where you got it from

I sometimes use an equivalent function which I just call q() to make
for even less typing :-)
However unless I am constructing a complex string, I tend to just
embed the quotes as I go.
With AppleScripts, I always test them in the AppleScript editor first.
Then copy them into Rev. If they are long, I put them in a field or
custom property and just use them from there. If they are short, I use
Rev's Script editor's "Paste as formatted string" menu item to insert
the script with all it's quotes.

> Am interested as it is one of the first functions I started to use as
> a library. I am in the process of removing small functions like this
> to make handlers a little more standalone - for instance at a quick
> check "kwote" is referenced by 452 other handlers in my library:
>
> function kwote string
>      return quote & string & quote
> end kwote
>
> So two questions:
>
>      1) How would you do this in a single line within a handler using
> "format"?

As shown in Chris's benchmarks, the quickest alternative is not to
call any other function but to put the quotes in directly.
>
>      2) Has anyone some code to safely and automatically update all
> of my 452 referenced handlers :)

Unless speed is an issue, I wouldn't worry about it.

Cheers,
Sarah



More information about the use-livecode mailing list