dickep Posted January 17, 2008 Share Posted January 17, 2008 Is it possible to have an application call a compiled AutoIT script and return a value back? Example from C++: if (AutoITScriptValue == 1) then do this; Thanks E Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 17, 2008 Share Posted January 17, 2008 Is it possible to have an application call a compiled AutoIT script and return a value back? Example from C++: if (AutoITScriptValue == 1) then do this; Thanks E Put an exit code on your Exit statement: ; Test1.au3, compiled to Test1.exe Exit 3oÝ÷ Ù§Â+a¶¬jëh×6; Test2.au3 $RET = RunWait(@ScriptDir & "\Test1.exe") MsgBox(64, "RET", "$RET = " & $RET) $RET = RunWait(@ComSpec & " /c " & @ScriptDir & "\Test1.exe") MsgBox(64, "RET", "$RET = " & $RET) Note carefully the two different results coming from two different way of running the compiled script: In the first you get $RET = 3 as expected because you ran the compile script directly. In the second you get $RET = 1 because that the exit code of CMD.exe (or COMMAND.com), which in turn was running the compiled script as a parameter. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
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