Function and Sub Procedures: Difference between revisions
Created page with "Procedures are blocks of program statements that can be conditionally and repeatedly executed ("called") from other statements in a program, with optional values (arguments) p..." |
No edit summary |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
Procedures are blocks of program statements that can be conditionally and repeatedly executed ("called") from other statements in a program, with optional values (arguments) passed in. When a procedure is called, it behaves like the Functions and Statements that make up the | Procedures are blocks of program statements that can be conditionally and repeatedly executed ("called") from other statements in a program, with optional values (arguments) passed in. When a procedure is called, it behaves like the Functions and Statements that make up the AppStudio language. FUNCTION procedures return a value, which can be stored in a variable or used in another expression. SUB procedures execute without returning a value. If a FUNCTION procedure is called and the return value is not used, AppStudio executes it as a SUB procedure. | ||
To pass in multiple arguments to a FUNCTION procedure, use a comma-separated list, enclosed in parenthesis. | |||
To pass in multiple arguments to a SUB or FUNCTION procedure, use a comma-separated list, enclosed in parenthesis. Do not leave any space between the function name and the left parenthesis. | |||
Simple variables, such as strings and numbers, are passed by value. Complex variables, such as arrays and objects, are passed by reference. | |||
Next: [[Projects,_Forms,_and_Controls|Projects, Forms, and Controls]] |
Latest revision as of 13:04, 1 July 2013
Procedures are blocks of program statements that can be conditionally and repeatedly executed ("called") from other statements in a program, with optional values (arguments) passed in. When a procedure is called, it behaves like the Functions and Statements that make up the AppStudio language. FUNCTION procedures return a value, which can be stored in a variable or used in another expression. SUB procedures execute without returning a value. If a FUNCTION procedure is called and the return value is not used, AppStudio executes it as a SUB procedure.
To pass in multiple arguments to a SUB or FUNCTION procedure, use a comma-separated list, enclosed in parenthesis. Do not leave any space between the function name and the left parenthesis.
Simple variables, such as strings and numbers, are passed by value. Complex variables, such as arrays and objects, are passed by reference.