JustDoIt Posted September 13, 2007 Posted September 13, 2007 I am still newbie to AutoIt. I wrote a function that includes a sub-function. The sub-function expects a string variable from the function. I'd like to compile the sub-function into an .exe file My question here is, how do I pass the string variable to the sub-function.exe ? Something like Run(' c:\sub-function.exe "some_string" ') from my Autoit function. Thanks for your input(s).
ofLight Posted September 13, 2007 Posted September 13, 2007 Search for $CmdLine in the Help File. There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly
JustDoIt Posted September 14, 2007 Author Posted September 14, 2007 I tried the code below but nothing happened If $CmdLine[0] = 1 Then $aVar = $CmdLine[1] RunWait("c:\myScript.exe" & $CmdLine[1], "", @SW_MAXIMIZE) endif
Moderators SmOke_N Posted September 14, 2007 Moderators Posted September 14, 2007 (edited) I would assume that you have the command line argument in the app you want to run, not in the one you are going to pass the string from. Main app:;whatever Run('"' & @HomeDrive & '\myScript.exe" ' & $sStringToPass, "", @SW_MAXIMIZE);Note the space after exe, if your string has spaces, you'll need to wrap that in quotes as well.oÝ÷ Ø i¶ç÷¬ ¦jwewºÚ"µÍY ÌÍÐÛY[VÌH[ÙÐÞ ][ÝÚ[É][ÝË ][ÝÔÝ[Î ][ÝÈ [È ÌÍÐÛY[VÌWJB[Y Edit: Blah@Edit Function! Edited September 14, 2007 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
JustDoIt Posted September 17, 2007 Author Posted September 17, 2007 Main app: Run('"' & @HomeDrive & '\myScript.exe" ' & $sStringToPass, "", @SW_MAXIMIZE) App that receives Command line: If $CmdLine[0] Then MsgBox(64, "info", "String: " & $CmdLine[1]) EndIf That works great. Thanks SmOke_N. Another question: is it possible to get a return value from "myScript.exe" back to the main script that is parsing a parameter to "myScript.exe" ?
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