> I know that UDT passes by reference

Interesting. The UV documentation for the CALL statement says: "All scalar
and matrix variables are passed to subroutines by reference. If you want to
pass variables by value, enclose them in parentheses."

Enclosing a matrix in parentheses apparently does not actually work.
(UV10.0.7 aix)

Vlisting the difference between a scalar and a vector (1D matrix) variable
surrounded by parentheses shows in the first example, using a scalar
variable, passes by value using a new internal variable _T0000. In the
second example, surrounding a vector in parentheses does nothing and the
vector is passed by reference, the same as if there were no parentheses.

--- 1
00005: CALL P2((A), MAT X)
00005 00022 : 0F8 move           A  => _T0000
00005 00028 : 01E call           "P2" _T0000 X

--- 2
00005: CALL P2((X(100)), MAT X)
00005 00018 : 01E call           "P2" X(100(1(X

Seems like a bug in the documentation.

This email message and any files transmitted with it are confidential
and intended solely for the use of addressed recipient(s). If you have 
received this email in error please notify the Spotless IS Support Centre (61 3 9269 
7555) immediately who will advise further action.

This footnote also confirms that this email message has been scanned
for the presence of computer viruses.

u2-users mailing list

Reply via email to