Keep in mind the following when working with functions:
- You can call functions within transactions or within functions.
- Variables declared within functions are automatic - not static as in transactions. They are allocated each time you call a
function.
- Only string variables can be initialized with the init keyword.
- Parameters of functions are called by reference.
- To return a value, assign the function call to an existing variable.
- You call functions using the name of the function in an expression or by
- using the name of the function as a single statement (when you are not interested in the return value of the function or when
the function does not have a return value).
- A return statement used in a function will always exit the function and the transaction that calls the function.