This shows you the differences between two versions of the page.
en:function [2016/08/13 09:06] admin |
en:function [2020/02/28 10:46] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Function (Statement) ===== | ||
- | ==== Format ==== | ||
- | **function** function_name ( [[functionvariablelist|function_variable_list]] )\\ | ||
- | (tab)[[programsyntax|statement(s)]]\\ | ||
- | **end function** | ||
- | |||
- | ==== Description ==== | ||
- | Create a function that will receive zero or more values, process those values and return either a value. | ||
- | |||
- | Function variables may a list of zero or more, comma separated, variables. | ||
- | |||
- | Functions can be defined anywhere in your program, and can not be defined within another function, [[Subroutine|Subroutine]] or control block ([[if|If/ | ||
- | |||
- | ==== Example ==== | ||
- | |||
- | < | ||
- | print double(" | ||
- | print double(9) | ||
- | print triple(3) | ||
- | end | ||
- | |||
- | function double(a) | ||
- | | ||
- | end function | ||
- | |||
- | function triple(b) | ||
- | | ||
- | end function | ||
- | </ | ||
- | will display\\ | ||
- | < | ||
- | HelloHello | ||
- | 18 | ||
- | 9 | ||
- | </ | ||
- | ==== See Also ==== | ||
- | {{page> | ||
- | |||
- | ==== History ==== | ||
- | |0.9.9.1|New To Version| | ||
- | |1.99.99.|Removed variable/ |