<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<b>On 03/08/18 14:25, KKing wrote:</b><br>
<blockquote type="cite"
cite="mid:8a7d5947-a69a-57c6-0ba0-f8153852e555@gmail.com">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>
</body>
</html>