Problems using Send and Functions with 2 parameters

Dar Scott dsc at swcp.com
Tue Aug 8 15:16:08 EDT 2006


On Aug 8, 2006, at 8:24 AM, Ian McKnight wrote:

> get randomTime(5,2)
> put the result


> send "get randomTime(5,2)" to group "analogClock"
> put the result

It seems Rev has a limited compiler when it comes to 'send'.  I'm not  
even sure what the meaning of 'get' would be in the above situation.

Your best bet would be to go with something more traditional.

First decide whether you want a function or a custom command.

For a function you would do this:

put randomTime(5,2)
   -- or
get randomTime(5,2)
put it

(You might be able to use value() to eval in the group, but that is  
to distracting for this email.)

For a custom command (made with 'on') you would do this:

randomTime 5,2 -- No Parens!
put the result

send "randomTime 5,2" to group "analogClock"
put the result -- will not work with 'in time'

Normally, 'the result' is used for errors, but it doesn't have to  
be.  It is a handy way to get results from objects you send to.  You  
can also return values with globals or with getProp.

The description of the function sounds like something that should be  
a function, so I'd wonder why it isn't in the message path of the  
object that needed it.  If it is used by a control in the group, then  
the group is in the message path.

Dar Scott




More information about the use-livecode mailing list