MadBoy Posted September 12, 2007 Share Posted September 12, 2007 Hello, Is there a way to return code from AutoIt compiled script the same way like functions do? I know that "Return" can be used only within functions, but i do need to return diffrent code then 0 (that is always returned for autoit scripts). Options like putting stuff into registry/creating files somewhere etc aren't solution for me and i know about them. This package is to be used in Altiris and it reads the return code and that's what my company expects from this package. With regards, MadBoy My little company: Evotec (PL version: Evotec) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 12, 2007 Moderators Share Posted September 12, 2007 (edited) Hello, Is there a way to return code from AutoIt compiled script the same way like functions do? I know that "Return" can be used only within functions, but i do need to return diffrent code then 0 (that is always returned for autoit scripts). Options like putting stuff into registry/creating files somewhere etc aren't solution for me and i know about them. This package is to be used in Altiris and it reads the return code and that's what my company expects from this package. With regards, MadBoyYou can get the exit code from the app from a dllcall() (from another app) if you don't want to write the exit code anywhere. You could use OnAutoItExit() + ConsoleWrite() and have the external app catch the stdout. Exit 4 Func OnAutoItExit() Switch @exitCode Case 0 MsgBox(64, "Info", "Normal Exit") Case 4 MsgBox(64, "Info", "Exit type 4") Case Else MsgBox(64, "Info", "Whatever") EndSwitch EndFunc Edited September 12, 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. Link to comment Share on other sites More sharing options...
MadBoy Posted September 12, 2007 Author Share Posted September 12, 2007 Exit 4 This alone will do just fine Smoke_N Wasn't aware that Exit can take values Testing it right now. My little company: Evotec (PL version: Evotec) 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