passing parameters in a send call.

Sarah Reichelt sarah.reichelt at gmail.com
Mon May 22 00:18:14 EDT 2006


On 5/22/06, Dar Scott <dsc at swcp.com> wrote:
>
> 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 '&'.

Hi Dar,

Great to have you back & contributing to the list :-)

I'm sure that at sometime in the past, I encountered a situation where
  send "myCmd x, y" to ...
didn't work, so I switched to the more verbose method. However I would
love to be wrong on this one, so I'll switch back and see if
everything works.

I don't use arrays much, so I didn't pick up on the real problem here,
thanks for that info.

Cheers,
Sarah



More information about the use-livecode mailing list