Appendix A
06/2005
Danaher Motion
166 Rev
E
M-SS-005-03
S
UBROUTINE
E
XAMPLE
Dim Shared var_x As Double
Dim Shared var_y As Long
Dim Shared array_z[2][2] As Double
Dim Shared rows As Long
Dim Shared columns As Long
Program
REM initialize variables
var_x=29.3172
var_y=5
rows=2
colums=2
array_z[1][1]=125.6
REM specification of program
<optional code>
CALL OrdinarySubroutine(var_x,var_y)
<more code>
CALL MatrixMath(array_z[1][1],rows,columns)
<more code>
End Program
SUB OrdinarySubroutine(param1 As Double, ByVal param2 As Long)
REM pass param1 by Reference, param2 by Value
REM declare local variables if any
REM specification of subroutine
<optional code using param1 and param2>
End Sub
SUB MatrixMath(matrix As Double, ByVal rows As Long, ByVal columns As Long)
REM pass matrix by Reference, rows by Value, columns by Value
REM declare local variables if any
REM specification of subroutine
<optional code using matrix, rows, and columns>
End Sub