Slide 28 of 65
Functions must have a return value and a return statement and cannot modify the parameters passed to them. They are called in statements where a value is needed (e.g. assignment statements, conditional tests). Note that only one value can be returned by a function call.
A function can have multiple return statements; the simulator will exit the function when it encounters the first return statement in the execution of the function.