Hard code or portable code

Dar Scott dsc at swcp.com
Wed Mar 10 18:45:28 EST 2004


On Wednesday, March 10, 2004, at 04:09 PM, hershrev wrote:

> Can I please have a little understanding on the parameter part of 
> functions what does it do or add?

Parameters are variables local to the function.

When the function is used, the values specified with the use are put 
into the variables.

An example (untested):

function double x
   return x*2
end double

on mouseUp
   put 1 into x
   put 2 into y
   put double(3) + double(x) + double(y+1)
end mouseUp
==>
14

You can have more than one parameter.  In use, they are separated by 
commas.  This is not the same as the comma operator (usually).

There are reference parameters, but that is more advanced.

Dar Scott



More information about the use-livecode mailing list