difference between function and command and sending parameters

J. Landman Gay jacque at hyperactivesw.com
Fri Oct 17 12:30:19 EDT 2008


william humphrey wrote:

> So my question is twofold.
> 
> 1. How do you send a "do" to a function.

You don't have to. Use this:

  get value("myfuction()",this card)

The second part ("this card") should be the script that holds the 
function; it may be the stack, a button, whatever. Put the correct 
script location in the second parameter.

> 
> and
> 
> 2. why would anyone use the function thing when they can use a command with
> a parameter. What good is a function? I guess when you want multiple
> parameters?

Command handlers can take multiple parameters too. The two are basically 
the same, with the exception that functions more easily return values. 
You can return a value with a command handler as well, but then you need 
to check "the result" in the calling script to see what came back.

This may be helpful:

<http://www.hyperactivesw.com/functions.html>


-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list