Developer Annoyance #1

Jim Ault JimAultWins at yahoo.com
Fri Mar 17 01:09:21 EST 2006


Ahh, if you are trying to make embedded quotes
as in 'the formatted string' construct ?

where localResult should be the string of    calc(varA,varB) of btn "source"

You can do the a few ways depending on your starting and ending strings and
your preference

ONE
put "calc(varA,varB) of btn "&quote&"source"&quote into localResult

TWO
put quote into q
put "calc(varA,varB) of btn "&q&"source"&q into localResult

THREE
put "calc(varA,varB) of btn ^source^" into localResult
replace "^" with quote in localResult

FOUR
make a simple 'formatted string' function that does the quoting for you.

If you are quoting for Unix or shell commands you may have to 'escape' them
in your function.
If you are quoting for HTML or AppleScript  or other, you may only have to
produce the simple replacement

Am I understanding your question?

Jim Ault
Las Vegas

On 3/16/06 9:43 PM, "Arthur Urban" <aturban at qwest.net> wrote:

> I think a new syntax needs to be made available for calling functions
> outside the message hierarchy. The existing mechanism does not lend
> itself to high readability or maintainability. Consider the following,
> if you will:
> 
>   put 1 into varA
>   put 2 into varB
>   put value( merge("calc([[varA]],[[varB]]))", btn "source" ) into
> localResult
> 
> further, if I need to protect the integrity of the variable passed it
> begins to look like this:
> 
>   put "1,2,3" into varA
>   put 4 into varB
>   put value( merge("calc([[quote&varA&quote]],[[varB]]))", btn "source"
> ) into localResult
> 
> I'm not sure that this is the right direction for any language to be
> headed. Please explain why we can't have the following syntax:
> 
>   put calc(varA,varB) of btn "source" into localResult
> 
> _______________________________________________
> 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