BlueScreen Posted January 15, 2004 Share Posted January 15, 2004 (edited) Just wanted to know what the "ByRef" optional parameter means (when using Functions). 10x Edited January 15, 2004 by BlueScreen Link to comment Share on other sites More sharing options...
Developers Jos Posted January 15, 2004 Developers Share Posted January 15, 2004 (edited) byref means that the value is returned to the variable in the calling code eg: $a=5 test($a) msgbox(0,"test", "$a=" & $a); $a will still be 5 Func test($a) $a = $a * 10 EndFunc$a=5 test($a) msgbox(0,"test", "$a=" & $a); $a will be the retruned result thus 50 Func test(byref $a) $a = $a * 10 EndFunc Edited January 15, 2004 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
BlueScreen Posted January 15, 2004 Author Share Posted January 15, 2004 10x alot! JdeB Link to comment Share on other sites More sharing options...
scriptkitty Posted January 15, 2004 Share Posted January 15, 2004 If you don't want to change the value of $a you can use the return option $a=5 $b=test($a) msgbox(0,"$a=" & $a, "$b=" & $b); $a stays 5, $b will be the returned result thus 50 Func test($a) $a = $a * 10 Return $a EndFunc AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now