Using Sub and Function Procedures in Code

A Function in your code must always be used on the right side of a variable assignment or in an expression.

For example:

Temp = Celsius(fDegrees)

To call a Sub procedure from another procedure, type the name of the procedure along with values for any required arguments, each separated by a comma. The Call statement is not required, but if you do use it, you must enclose any arguments in parentheses.

The following example shows two calls to the MyProc procedure. One uses the Call statement in the code; the other doesn't. Both do the same thing.

	Call MyProc(firstarg, secondarg)
	MyProc firstarg, secondarg

Notice that the parentheses are omitted in the call when the Call statement isn't used.

Example

Sub MyProc(inpParam)
	    inpParam = 20
	End Sub
	Param = 10
	MyProc Param