kcd-clan Posted April 1, 2013 Posted April 1, 2013 Here is what we have. command("test",'0,"test","ahhh"') Func test($msg1,$msg2,$msg3,$msg4=0) MsgBox($msg1, $msg2, $msg3,$msg4) EndFunc Func command($cmd$,$myArray) Call($cmd, $myArray) EndFunc I think this should do as far as information. I extracted it and simplified because to real code has alot of loops and user defined function calls. Once i get this missing piece i can move on. Bassically the issue i think i have is, I call command and array isnt defined so it will error itself. My debugger i made tells me invalid command... IDK just posting this makes me think maybe the issue isnt the array. Visit mEMy programs made.Iul - IulG-V Console - G-V Console_RandomLetter - _RandomLetter()Saftey Kill - Saftey Killcolorzone() = colorzone()
matwachich Posted April 1, 2013 Posted April 1, 2013 You need to learn the language a little more: You cannot pass >2 arguments to a function that waits only 2The solution to avoid messy code is the Execute function$sCmd = 'MsgBox(0, "Test", "Hi!")' Execute($sCmd)
JohnOne Posted April 1, 2013 Posted April 1, 2013 No-where near enough info to diagnose a problem. For starters you are calling a function which takes 2 arguments with 3. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
kcd-clan Posted April 1, 2013 Author Posted April 1, 2013 You need to learn the language a little more: You cannot pass >2 arguments to a function that waits only 2 WOOOOOH TY much. The solution to avoid messy code is the Execute function $sCmd = 'MsgBox(0, "Test", "Hi!")' Execute($sCmd) Visit mEMy programs made.Iul - IulG-V Console - G-V Console_RandomLetter - _RandomLetter()Saftey Kill - Saftey Killcolorzone() = colorzone()
PhoenixXL Posted April 1, 2013 Posted April 1, 2013 This is another example to call from an Array, I found it in the FORUM and it was written by TrancexxFunc CallArrayEx($sFuncName, $aNew) $aRet = $sFuncName & "(" For $n = 0 To UBound($aNew) - 1 $aRet &= "$aNew[" & $n & "]," Next ;Execute $aRet = Execute(StringTrimRight($aRet, 1) & ")") ;Finally return Return SetError(@error, @extended, $aRet) EndFunc ;==>CallArrayEx Local $aParameters[3] = [64, "Hello There", "Tested Successfully"] CallArrayEx("MsgBox", $aParameters) $aParameters = "64|Hello There|Tested Successfully" CallArrayEx("MsgBox", StringSplit($aParameters, "|", 2)) My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.
water Posted April 1, 2013 Posted April 1, 2013 What you pass here as parameter 2 isn't an array. It's just a string: command("test",'0,"test","ahhh"')Use function StringSplit to create an array from this string. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
PhoenixXL Posted April 1, 2013 Posted April 1, 2013 I have elaborated what Water saidLocal $aSplit = StringSplit('0,"test","ahhh"', ",") $aSplit[0] = "CallArgArray" ;First element should be this string according to the Help File. command("test", $aSplit) Func test($msg1, $msg2, $msg3, $msg4 = 0) MsgBox($msg1, $msg2, $msg3, $msg4) EndFunc ;==>test Func command($cmd, $myArray) Call($cmd, $myArray) EndFunc ;==>command My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.
water Posted April 1, 2013 Posted April 1, 2013 Great! Learned something new today My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
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