Passing parameters by reference

jawahar

Member
Licensed User
Longtime User
Hi,
From the Beginners Guide, I understand that in B4A, the parameters are transmitted by value and not by reference(section14.5.5 - Parameters).
In VB, when I needed to return more than one parameter to the calling function I used to use ByRef. How can I do that in B4A? I understand that if I use a Non-Primitive then this is possible but what about primitives.....

For example in VB6 a simple swap would be

Public Swap(Byref A as Long, Byref B as Long)
Dim C as Long
C = A: A = B: B = C
End Sub


Thanks & regards,

Jawahar
 
Top