Gretl Manual: Gnu Regression, Econometrics and Time-series Library | ||
---|---|---|
Prev | Chapter 11. User-defined functions | Next |
The parameters (if any) of a user function are defined implicitly — as in bash — via references in the function body. Within the body, you use $1 to refer to the first parameter, $2 for the second, and so on. These numbered references will be replaced by the supplied arguments (if any) when the function is called.
Parameter replacement is by simple string substitution. There is no mechanism for "passing parameters by value", as in some programming languages.