Parameters [WAS: Main menu puzzle]

Mark Swindell mdswindell at cruzio.com
Sun Feb 19 21:31:00 EST 2006


On Feb 18, 2006, at 9:43 AM, J. Landman Gay wrote:

> Mark Swindell wrote:
>> Parameters are, to me, the least well-explained and  least  
>> intuitive aspect of Rev (and programming in general).
>
> You can have any number of parameters declared in a handler:
>
> on myHandler pOne,pTwo,pThree <etc>
>  ...
>
> If the engine (or one of your own handlers) passes three parameters  
> to this handler, each parameter "basket" will hold one of the items  
> that is passed to it.
>
> If more parameter items are passed than you have declared parameter  
> "baskets" to hold, the extra ones are not available to your script.  
> (There is a way around this using "the params" but that is more  
> advanced than we want to talk about here.)
>
> If fewer parameter items are passed to your handler than you have  
> "baskets" declared, the extra baskets are empty.
>
> Feel free to ask for clarification, I wrote this very quickly.

This explanation was quite good, as is usual for the source...  
thanks :)  The tone of this short tutorial is exactly what the doctor  
ordered for making Rev comprehensible to new users.  The latter part   
regarding multiple parameters after declaring the handler is key, as  
naming multiple "baskets" and filling them- or not- is the part that  
is not at all intuitive. Fleshing this out with a few examples would  
be a godsend to the documentation.  "Assume nothing" about the new  
user is the best route to comprehensible explanations for everyone at  
that level... and on up.

Thanks,

Mark



More information about the use-livecode mailing list