Parentheses must be added for an array.
For example, the sub EM (pay () as single) process is defined)
Calling process EM (Xu ())
Pass by value (byval): The parameters and real parameters occupy different buckets. The value of the parameter variable is changed during the call process, and the value of the real parameter is not affected. After the call is complete, the real parameter is still the value before the call,
Private sub commandementclick ()
Dim X as integer
X = 6
Print "before the sub process is called X ="; x
Call test (X)
Print "x ="; x
End sub
Sub test (byval M as integer)
M = m + 5
End sub
Pass by address (byref, Default Transfer Method): During the call process, the address of the real parameter variable is passed to the form parameter and the same address is used. Therefore, the same data type is used. Only when the real parameter is a variable or array can it be passed by address, if it is a constant, it is actually passed by value.
Private sub commandementclick ()
Dim X as integer
X = 6
Print "before the sub process is called X ="; x
Call test (X)
Print "x ="; x
End sub
Sub test (byref M as integer)
M = m + 5
End sub
Parameters are transmitted by address when an array is used as parameters. The keyword "byval" cannot be used to modify the parameters.