Use of the "Send" command
Klaus major-k
klaus at major-k.de
Wed Jun 1 15:07:14 EDT 2016
Hi Paul,
> Am 01.06.2016 um 21:00 schrieb Paul Dupuis <paul at researchware.com>:
>
> I want to send a message with parameters after a interval to an object.
>
> The is just 'send "myMessage" to tObject in 200 milliseconds' - works fine.
>
> When I want to invoke a message with multiple parameter, I generally use
> "dispatch" so I can so something like 'dispatch "myMessage" to tObject
> with tParam1,tParam2,tParam3' where the variable tParam1,2,3 can contain
> pretty much whatever I want
>
> However, if I have variable tParam1 say with
> 'C:\somefolder\someotherfolder\somefile.txt' and tParam2 with 'some text
> with "quotes" in it" to write' and tParam3 with a boolean true|false, I
> am having problems constructing a send in time that works.
>
> I have a handler for myMessage in tObject that is
>
> on myMessage pParam1, pParam2, pParam3
> -- do stuff
> end myMessage
>
> but constructs like
>
> send "myMessage"&&tParam1&comma&tParam1&comma&tParam3 to tObject in 100
> milliseconds
> or
> send ("myMessage"&&tParam1&comma&tParam1&comma&tParam3) to tObject in
> 100 milliseconds
>
>
> does not map the parameters correctly. i.e. if I look at the values of
> pParam1,2,3 in the myMessage handler I get parts of the values passed or
> none at all. Most often I just get up to the first \ in pParam1 and 2
> and 3 are empty. I have tried other variants and still not passing
> parameters correctly. I think my brain is just not in gear from lack of
> sleep and I am missing something very obvious, but rather that beating
> my head against a wall, I though I would ask and see if someone can give
> me the correct syntax
do this:
...
send "myMessage tParam1,tParam2,tParam3" to tObject in 100 milliseconds
…
:-)
Best
Klaus
--
Klaus Major
http://www.major-k.de
klaus at major-k.de
More information about the use-livecode
mailing list