BugFix Posted April 1, 2013 Posted April 1, 2013 Hi,i have a problem with I want to call a methode with one or more parameter as ByRef. Inside the methode it works properly, but the ByRef-variable itself will not change value.Any ideas?#include <AutoItObject.au3> _AutoItObject_Startup() $oTest = _CreateObjFunc('Test') $a1 = 5 ConsoleWrite('Return Methode = ' & $oTest.Meth($a1, 3, 5) & ' [OK]' & @LF) ConsoleWrite('ByRef "$a1" after methode-call = ' & $a1 & ' [FAIL]' & @LF) ; == parameter $a1 was changed inside methode - but $a1 is'nt changed after call ;------------------------------------- OBJECT ------------------------------------------------------ Func _CreateObjFunc($_sName) Local $oSelf = _AutoItObject_Create() _AutoItObject_AddMethod($oSelf, 'Meth', "_Meth") Return $oSelf EndFunc Func _Meth(ByRef $oSelf, ByRef $A, $B, $C) $A += $B + $C Return $A EndFunc ;--------------------------------------------------------------------------------------------------- Best Regards BugFix
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