Note: This is a work in progress and many formatting issues have been fixed. Read more about the project on the home page.
The function keyword defines a new function handler of the specified name. You call a function by placing parentheses after its name, enclosing any parameters within the parentheses:
get deleteSpaces(" hello ")
The optional parameterList lets a function handler receive values sent along with the function call.
When a function is called, HyperCard evaluates each item within the parenthetical list following the function's name. When the handler begins to execute, HyperCard assigns each value to a parameter variable in the parameterList.
Use the return keyword within the function definition to have the function return a value to the handler that called it. If you don't use return, the function evaluates to empty.
Any text string, without quotation marks, that represents the name of the function handler you want to write:
As in the HyperTalk examples:
A comma-separated list of local variable names.
The actual names don’t matter as long as they’re not the same as one of HyperCard’s reserved words. (That is, don’t use result as a variable name.) For example:
Any return-separated list of built-in commands, user-defined handlers, or keywords that are part of a message or function handler.