<div dir="auto">Well there is also the tricks of passing an array<div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">If you modify a value in an object... you modify the object not the ref... so it's an indirect byref argument</div></div><br><div class="gmail_quote"><div dir="ltr">Le ven. 3 août 2018 19:40, ML <<a href="mailto:d4t4full@gmail.com">d4t4full@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<b>On 03/08/18 14:25, KKing wrote:</b><br>
<blockquote type="cite">Can a
Function update the content of the parameter values before
returning and or have the concept of the "OUT" parameter?
<br>
K.<br>
</blockquote>
<br>
Yes, altough you suuuure know it's "not a good programming
practice", right? (ahem)<br>
To achieve it you should use the ByRef parameter access modifier,
but the tweak is that you should use in both, the call AND the
sub/function declaration:<br>
<br>
' Gambas class file<br>
<br>
Public Sub Form_Open()<br>
<br>
Dim i As Integer = 10<br>
<br>
ChangeInputParameter(ByRef i)
'Note the BYREF modifier<br>
<br>
Message.Info("I = " & CStr(i))<br>
<br>
End<br>
<br>
Private Sub ChangeInputParameter(ByRef myVar As Integer)
'Note the BYREF modifier<br>
<br>
myVar = myVar + 10<br>
<br>
End<br>
<br>
Also: Try removing any one of the two ByRef keywords.<br>
<br>
You can, of course, also use ByRef in Functions, not only in Subs.
This was just a Q&D (quick & dirty) example.<br>
Don't know if it can be used in Properties, though...<br>
<br>
zxMarce.<br>
</div>
<br>
----[ Gambas mailing-list is hosted by <a href="https://www.hostsharing.net" rel="noreferrer noreferrer" target="_blank">https://www.hostsharing.net</a> ]----<br>
</blockquote></div>