Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

AutoItObject -- call methode with parameter ByRef?

$
0
0
Hi,
i have a problem with AutoitObject UDF.
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?

[ autoit ]         
#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 ;---------------------------------------------------------------------------------------------------

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>