passing parameters in a send call.

Dar Scott dsc at swcp.com
Sun May 21 17:28:28 EDT 2006


On May 21, 2006, at 3:01 PM, Sarah Reichelt wrote:

> I always use something like:
>   send "myAdd " & pArrayA to stack "someStack"
>
> so that the variable is evaluated before the send.

Hi, Sarah!

I'll pick on two aspects of that.


First of all, I haven't been convinced that there are any merits to  
this:

    send "myCmd " & x & comma & y to ...

Over this:

    send "myCmd x, y" to ...

And it has some potential problems, such as when x contains a comma.   
(Also, the latter lends itself to some future (I hope) compiler  
optimization that compiles code that does not require runtime  
compiling.)


Second, in this particular case where pArrayA is an array, the  
expression '"myAdd " & pArrayA' will resolve to "myAdd ".  The array  
value looks empty to '&'.

Dar



More information about the use-livecode mailing list