daveed Posted September 4, 2007 Posted September 4, 2007 hi, i have a couple of text input boxs and would like to pass the values in them into to run() like this $aInput = GUICtrlCreateInput("-w", 10, 110, 120, 19) $aInput2 = "100" Run("filename" & '$aInput' & '$aInput2' "-z FILENAME.txt","", @SW_HIDE)
Generator Posted September 4, 2007 Posted September 4, 2007 Probably....Not tested... $aInput = GUICtrlCreateInput("-w", 10, 110, 120, 19) $aInput2 = "100" Run("filename" & GUICtrlRead($aInput) & GUICtrlRead($aInput2) "-z FILENAME.txt","", @SW_HIDE)
TK_Incorperate Posted September 4, 2007 Posted September 4, 2007 Not sure completely, not tested, but I'm pretty sure it needs to look like this. $aInput = GUICtrlCreateInput("-w", 10, 110, 120, 19) Global $aInput2 $aInput2 = "100" Run("filename" & GUICtrlRead($aInput) & $aInput2 & "-z FILENAME.txt","", @SW_HIDE) 2 things you did wrong, the $aInput2 was not declared before you set a value to it, and you forgot an "&" in between the $aInput2 and "-z FILENAME.txt". $aInput2 could not be read by GuiCtrlRead because it is not a control inside a GUI, it is simply a variable that has a value. ~TK
Generator Posted September 4, 2007 Posted September 4, 2007 Not sure completely, not tested, but I'm pretty sure it needs to look like this. $aInput = GUICtrlCreateInput("-w", 10, 110, 120, 19) Global $aInput2 $aInput2 = "100" Run("filename" & GUICtrlRead($aInput) & $aInput2 & "-z FILENAME.txt","", @SW_HIDE) 2 things you did wrong, the $aInput2 was not declared before you set a value to it, and you forgot an "&" in between the $aInput2 and "-z FILENAME.txt". $aInput2 could not be read by GuiCtrlRead because it is not a control inside a GUI, it is simply a variable that has a value. ~TKDidn't bother go in with the details, what he said.
daveed Posted September 4, 2007 Author Posted September 4, 2007 Thanks for the reply, I now get a error: The system cannot find the file specified. The .exe that is getting the flags are in the same dir. This passes fine Run("program.exe -w 100 -z FILENAME.txt","", @SW_HIDE) I have tryed and the error applys to the following: Run(@ScriptDir & "program.exe" & GUICtrlRead($aInput) & GUICtrlRead($aInput2) "-z FILENAME.txt","", @SW_HIDE) Run("program.exe" & GUICtrlRead($aInput) & GUICtrlRead($aInput2) "-z FILENAME.txt","", @SW_HIDE) Run("C:\tests\autoit\test\program.exe" & GUICtrlRead($aInput) & GUICtrlRead($aInput2) "-z FILENAME.txt","", @SW_HIDE)
Moderators SmOke_N Posted September 4, 2007 Moderators Posted September 4, 2007 (edited) Run(@ScriptDir & "program.exe"oÝ÷ Ûú®¢×m¶¼ºÚ"µÍ[ØÜ [È ][ÝÉÌLÜÙÜ[K^I][ÝoÝ÷ Ø l£^*.j·©jË"«éÛ2¢é¢e¢µ§]x-ë)iÇzÜz{azf§vZ(«pªix2¢êßW©jØlwh¹¹^ªê-zÅ¢Û-i¶®¶se'Vâb33²gV÷C²b33²fײ67&DF"fײb33²b3#·&öw&ÒæWRgV÷C²b33²fײuT7G&Å&VBb33c¶çWBfײgV÷C²gV÷C²fײuT7G&Å&VBb33c¶çWC"fײgV÷C²×¢dÄTäÔRçGBgV÷C²ÂgV÷C²gV÷C²Â5uôDR Edit: Takes time to re-write after a forum edit screw up!! Edited September 4, 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.
TK_Incorperate Posted September 4, 2007 Posted September 4, 2007 Try this one here, since you are ALWAYS using 100 $aInput = GUICtrlCreateInput("-w", 10, 110, 120, 19) $String = GuiCtrlRead($aInput) Run("filename" & $String & "100 -z FILENAME.txt","", @SW_HIDE)
daveed Posted September 4, 2007 Author Posted September 4, 2007 Thanks, guys for the help and explaining it
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