Aces Posted July 9, 2007 Share Posted July 9, 2007 (edited) Problem fixed. (i just had a blank out for a sec up there ^^) Edited July 9, 2007 by Aces ~~ AutoIt v3 Minion ~~Name: Kevin "Aces-X" MorrisOrganization: A C DevelopmentE-Mail: AcesX91@acecoding.netOS: XP Professional; Vista package~~ Released Software ~~CPU-Mach: Topic at acecoding.net ForumsProxyzBuddy: Beta testing at the moment, private onlyWHSTool: Not released to the public Link to comment Share on other sites More sharing options...
/dev/null Posted July 9, 2007 Share Posted July 9, 2007 Func RunMenu() $input = InputBox("Run...", "Please type the path/file you would like to run.") If Run($input) = @error Then Return 1 MsgBox(0, $GUItitle, "Could not run " & $input & " at this time.") EndIf EndFunc if $input does not execute then the "If" line remains false, and cancels out the "If -> EndIf" commands. anyone see a flaw? Run() returns the PID of the process. Chances a very low, that the PID will ever be equal @error.... __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
Aces Posted July 9, 2007 Author Share Posted July 9, 2007 hrm.. isnt @error a premade macro? ~~ AutoIt v3 Minion ~~Name: Kevin "Aces-X" MorrisOrganization: A C DevelopmentE-Mail: AcesX91@acecoding.netOS: XP Professional; Vista package~~ Released Software ~~CPU-Mach: Topic at acecoding.net ForumsProxyzBuddy: Beta testing at the moment, private onlyWHSTool: Not released to the public Link to comment Share on other sites More sharing options...
Aces Posted July 9, 2007 Author Share Posted July 9, 2007 alright, fixed the auto exit fatal error problem but it still doesnt pop up the msg box i will edit for update ~~ AutoIt v3 Minion ~~Name: Kevin "Aces-X" MorrisOrganization: A C DevelopmentE-Mail: AcesX91@acecoding.netOS: XP Professional; Vista package~~ Released Software ~~CPU-Mach: Topic at acecoding.net ForumsProxyzBuddy: Beta testing at the moment, private onlyWHSTool: Not released to the public Link to comment Share on other sites More sharing options...
/dev/null Posted July 9, 2007 Share Posted July 9, 2007 Func RunMenu() $input = InputBox("Run...", "Please type the path/file you would like to run.") $Run = Run($input) If $Run = @error Then MsgBox(0, $GUItitle, "Could not run " & $input & " at this time.") EndIf EndFunc cancels out the "If -> EndIf" commands. anyone see a flaw? Again: Run() returns the PID (process ID). That's not an error code!! So, why do you compare the PID with @error ??? __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
ChrisL Posted July 9, 2007 Share Posted July 9, 2007 (edited) Func RunMenu() $input = InputBox("Run...", "Please type the path/file you would like to run.") $Run = Run($input) If $Run = @error Then MsgBox(0, $GUItitle, "Could not run " & $input & " at this time.") EndIf EndFunc cancels out the "If -> EndIf" commands. anyone see a flaw? Func RunMenu() $input = InputBox("Run...", "Please type the path/file you would like to run.") $Run = Run($input) If $Run = 0 Then MsgBox(0, $GUItitle, "Could not run " & $input & " at this time.") EndIf EndFunc Edited July 9, 2007 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
MHz Posted July 9, 2007 Share Posted July 9, 2007 If Run() fails, then a good chance that a fatal error will happen. To control the error yourself, then use Opt() with "RunErrorsFatal". Func RunMenu() Opt('RunErrorsFatal', 0) $input = InputBox("Run...", "Please type the path/file you would like to run. Use double quotes if needed") $pid = Run($input) If @error Then MsgBox(0, $GUItitle, "Could not run " & $input & " at this time.") EndIf ProcessWaitClose($pid) EndFunc 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