SUB statement |
Top Previous Next |
Declares the name, parameters and code that define a Sub procedure.
The parameter list contains one or more variables separated by a comma, the datatype must not be declared. Parameters by reference must be declared by using the BYREF directive.
You can use "Return" or "Exit Sub" statement to exit a sub.
Use a FUNCTION statement when you need to return a value to the calling code. Use a SUB procedure when you do not need to return a value.
Example:
|