Part III: User-Defined Functions

At the top of your script you define the arguments. A minimum of two arguments are needed:

Arguments @retval data

The function returns values to the retval variable, and data is the first variable passed into the function.