You call a procedure by specifying the procedure name and its parameters.
Before you can insert a user-defined command as code, make sure you are in one of the following Code views where programming code can be entered to call the procedure:
Procedure Code View
Tests Code View of a program
Click in the Code View of the Procedures View and enter the programming code to call the procedure.
The following example shows how the Max function, a user-defined procedure, is tested. The Max function returns the maximum number of any given two numbers.
The test code in the Tests Code View above uses an array of type long (alArray) to hold 20 items (long integers). The test array, alArray, is set to the numbers zero to 19.
The Max procedure tests the code. It is used to compare the items in the array to determine which value is greater, to store the result as d, and then to return the greater value.
The TestStatus part of the code verifies that the result is as expected. If the result is not equal to 19, the highest value, then the test fails.
To call the result (d), you can use the following example code:
d=Max(1,10) |
|
print d |
!This will print 10. |
For information on entering programming code, see Entering Code.