You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Alvin Cheng edited this page Jan 9, 2023
·
1 revision
Description
This is the function command, this command will declare a function that can be called with the call command. Furthermore, this command takes a function name, an arguments list and a body. The function name is in argument 1 from argument 1 beyond is an argument list and the final argument is the body that runs when it's called.
Note
All function names MUST be prefixed with FUNC to indicate that it's a function.
Function??
A function in programming is a block of code that has a name and an argument list so the output can be altered by the arguments. In other words, a function is a machine that will output some data BASED on the input. A function can make your code more simple by reducing code duplication as functions can be called with one line compared to writing the whole thing multiple times.
Example
function $FUNC_FUNCTION $ARGUMENT (
# Code here...
)