Note that the PC-DMIS Basic Script Editor does not have a compiler messages window, terminal window, or debug window to see Print messages. To see strings or messages when you execute your script in the PC-DMIS Basic Script Editor, you may want to use the MsgBox statement instead.
Sub Main () Dim x(5) As Integer Dim i As Integer For i = 0 to 5 x(i) = i Next i Print i Joe (i, x) ' The parenthesis around it turn it into an expression which passes by value Print "should be 6: "; x(2), i End Sub Sub Joe( ByRef j As Integer, ByRef y() As Integer ) Print "Joe: "; j, y(2) j = 345 For i = 0 to 5 Print "i: "; i; "y(i): "; y(i) Next i y(2) = 3 * y(2) End Sub