Home > Available Help Files > PC-DMIS BASIC Language > Cypress Enable Scripting Language Elements > Subroutines and Functions > ByRef and ByVal > Scalar Variables
Current Help File: PC-DMIS Basic (View Core Help)
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