Parameters: Difference between revisions
Jump to navigation
Jump to search
Created page with "Optional '''parameters''' are values passed to SUB and FUNCTION procedures. They are always enclosed in parenthesis inside the procedures. {{PageSyntax}} ::: SUB SubName['''(''parameter''''' [{{KW|AS}} {{KW|Type}}][''', ...''']''')'''] ::: FUNCTION FunctionName['''(''parameter''''' [{{KW|AS}} {{KW|Type}}][''', ...''']''')'''] ::: CALL SubName['''(''parameter'''''[''', ...''']''')'''] ::: SubName ['''''parameter'''''][''', ...'''] ::: FunctionName[''..." |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
{{PageSyntax}} | {{PageSyntax}} | ||
::: [[SUB]] SubName['''(''parameter''''' [ | ::: [[SUB]] SubName['''(''parameter''''' [[[AS]] [[Variable Types|Type]]][''', ...''']''')'''] | ||
::: [[FUNCTION]] FunctionName['''(''parameter''''' [ | ::: [[FUNCTION]] FunctionName['''(''parameter''''' [[[AS]] [[Variable Types|Type]]][''', ...''']''')'''] | ||
::: [[CALL]] SubName['''(''parameter'''''[''', ...''']''')'''] | ::: [[CALL]] SubName['''(''parameter'''''[''', ...''']''')'''] | ||
::: SubName ['''''parameter'''''][''', ...'''] | ::: SubName ['''''parameter'''''][''', ...'''] | ||
Line 20: | Line 20: | ||
{{PageSeeAlso}} | |||
* [[SUB]] | * [[SUB]] | ||
* [[FUNCTION]] | * [[FUNCTION]] |
Latest revision as of 20:28, 26 January 2024
Optional parameters are values passed to SUB and FUNCTION procedures. They are always enclosed in parenthesis inside the procedures.
Syntax
Usage:
- Inside of sub-procedures, multiple parameters variables are separated by commas in a list and always enclosed inside of parenthesis.
- When CALL is used to call a SUB procedure all parameters must be enclosed inside parenthesis too.
- When just the procedure name is used to call a SUB, the parameters are listed after the name. Multiple parameters require commas.
- FUNCTION procedure parameters are always enclosed in parenthesis. Multiple parameters are separated by commas.
- Parameters can be literal values or variables when a SUB procedure is called or a FUNCTION procedure is referenced.
- To pass parameter variables by value to protect the value in a call, parenthesis can be placed around each variable name also.
- To pass arrays to a sub-procedure use empty brackets after the name or indicate the index in the call.
See also