How to pass by reference ByRef
Posted: Wed Jan 29, 2014 12:46 am
I have researched the forums and have seen many ways to pass a value by reference and am now confused as the which is the best method. In VisualBasic 6 and PowerBasic you can specify the keyword "ByRef", so I am simply looking for the equivalent way in PureBasic.
The following works, but is it the "proper" way? I just want something easy and reliable.
ProcedureDLL DoubleByRef(*num1.Double)
*num1\d = 17
EndProcedure
Define d1.d = 7
DoubleByRef( @d1 )
; Now d1 = 17

The following works, but is it the "proper" way? I just want something easy and reliable.
ProcedureDLL DoubleByRef(*num1.Double)
*num1\d = 17
EndProcedure
Define d1.d = 7
DoubleByRef( @d1 )
; Now d1 = 17