param | |||||||
Type | function | ||||||
Dictionary | LCS | ||||||
Library | LiveCode Script | ||||||
Syntax |
| ||||||
Summary | Returns the specified parameter passed to the current handler. | ||||||
Introduced | 1.0 | ||||||
OS | mac, windows, linux, ios, android | ||||||
Platforms | desktop, server, mobile | ||||||
Parameters |
| ||||||
Example |
| ||||||
Values |
| ||||||
Related | Control Structure: function Glossary: pass, handler, parameter, return Function: paramCount | ||||||
Description | Use the param function within a handler to get the value of a parameter when you don't know in advance how many parameters will be passed to the handler. Usually, you assign names to parameters in the first line of a function handler or message handler. For example, the following function assigns three parameters, which are multiplied together:
But if you want to multiply all the numbers passed to the function handler together, you don't know ahead of time how many parameters will be passed, so you can't assign a parameter name (such as firstFactor) to each one in the first line of the function handler. In this case, you can use the param function to use each parameter without needing to assign it a name:
LiveCode evaluates the parameters before passing them. So if you call myHandler with the following statement:
the parameters returned by the param function are
| ||||||
Tags | properties |