
Function with ByRef Variables using AdlibRegister
By
ViciousXUSMC, in AutoIt General Help and Support
-
Similar Content
-
By FMS
Hello,
I've an error and don't know why and hope somebody can help me..
I think maybe i din't include somethin for the "ByRef" function, but i could be wrong :S
Anyway here is what i included ...
#include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <File.au3> ; for _FileCreate ed. #Include <GuiComboBoxEx.au3> ; for _GUICtrlComboBoxEx_ResetContent #include "EzMySql.au3" #include <Array.au3> This is what i do before the error starts ... (everything else is running properly)
$query = "SELECT * FROM `users` ;" $hostname = Read_from_ini("app","server","ip","no_server_ip") $dbname = "blokkerreferencedata" $usrname = Read_from_ini("app","server","username","no_server_usr") $Pass = Read_from_ini("app","server","pass","no_server_pass") $SQLport = Read_from_ini("app","server","sql_port","no_server_port") $iresult_rows = "" $iresult_colums = "" $iresult = get_result($query,$hostname,$dbname,$usrname,$Pass,$SQLport,ByRef $iresult_rows,ByRef $iresult_colums) _ArrayDisplay($iresult,"result") Here is the error i get...
==> Error in expression.: $iresult = get_result($query,$hostname,$dbname,$usrname,$Pass,$SQLport,ByRef $iresult_rows,ByRef $iresult_colums) $iresult = get_result($query,$hostname,$dbname,$usrname,$Pass,$SQLport,^ ERROR does somebody see what i do wrong here???
thanks in advanced.
ps. if it isn't a forgotten "include" --> how does somebody know whish include to use???
-
By ur
I have function which needs 3 parameters and the last one is passed ByReference.
ReadFunction($strFunctionName,ByRef $countArgts)
But can I make the reference parameter as optional.i.e., $countArgts as optional or to keep a default value as below.
ReadFunction($strFunctionName,ByRef $countArgts=1560)
This is giving a compilation error, or any method overloading approach like in Programming languages Java,etc.
-
By rudi
Hi.
Reading the help file I noticed the directive "#forceref" in sereral sample codes, e.g. for "ByRef" in this line:
#forceref $v1, $v2, $v3, $v4, $v5, $v6, $v7, $v8, $v9, $v10, $v11, $v12, $v13, $v14, $v15, $v16, $v17, $v18, $v19
What is it's effect? searching the help file, I can find it "outside" of sample code just for this entry:
Au3check syntax tool
#forceref $varname [, ...] can be used for inside functions, like the following: Func Test_Numparams($v1 = 0, $v2 = 0, $v3 = 0, $v4 = 0, $v5 = 0, $v6 = 0, $v7 = 0, $v8 = 0, $v9 = 0) #forceref $v1, $v2, $v3, $v4, $v5, $v6, $v7, $v8, $v9
Same question for #forcedef
From this postings here I don't get the exact effect either:
(#forceref)
(#forcedef)
Regards, Rudi.
Regards, Rudi.
-