the syntax of a function could be summarized as:
Say, yuor variable is named X in the function, then all you need to do is:
If you call the function as:
your variable will be assigned automatically to ans, otherwise to
anyname will be what is X in your function.
As Aldin pointed out, if you're in a GUI then use: