Jump to content

Silent Crash


Recommended Posts

Hello, this has probably been answered before, but how can I make a script crash silently instead of bringing up the error popup? and an extension of that, can I also make it so it can bring up something else, like a message box that just says "critical error"?

Thanks

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

Erm, could you give me an example? I made this to try and figure out what you meant.. but...

HotKeySet("{F5}","crash")

While 1

If @error Then Exit

WEnd

Func crash()

Run("omfge.xhy") ;This file doesn't exist

EndFunc

EDIT: I Achieved it by using AutoItSetOption("RunErrorsFatal",0) but that only stifles Run() Errors, howabout all of em?

Edited by MethodZero

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

Example for GUICreate()

GUICreate

--------------------------------------------------------------------------------

Create a GUI window.

GUICreate ( "title" [, width [, height [, left [, top [, style [, exStyle [, parent]]]]]]] )

Parameters

title The title of the dialog box.

width [optional] The width of the window.

height [optional] The height of the window.

left [optional] The left side of the dialog box. By default (-1), the window is centered. If defined, top must also be defined.

top [optional] The top of the dialog box. Default (-1) is centered

style [optional] defines the style of the window. See GUI Control Styles Appendix.

Use -1 for the default style which includes a combination of $WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU styles.

Some styles are always included: $WS_CLIPSIBLINGS, and $WS_SYSMENU if $WS_MAXIMIZEBOX or $WS_SIZEBOX is specified.

exStyle [optional] defines the extended style of the window. See the Extended Style Table below. -1 is the default.

parent [optional] The handle of another previously created window - this new window then becomes a child of that window.

Return Value

Success: Returns a windows handle.

Failure: Returns 0 if the window cannot be created and sets @error to 1.

Link to comment
Share on other sites

Thanks, I'll use If @error Then Exit

Thanks again

Edited by MethodZero

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...