Alek Posted February 4, 2009 Share Posted February 4, 2009 thought it might come in handy when debuging was kinda surprised it worked Global Const $Notify_Assert_Error = True _Assert("B" == "B") MsgBox(0,"Oh hai", "Yay!!! made it past first assertion") $x = 23 _Assert($x > 12) MsgBox(0, "Oh hai","Wow, we got past the seacond one as well :D") $y = 13 _Assert($x < $y) MsgBox(0, "Oh noes","Oh hai their, how did you make it this far??") Func _Assert($test, $line = @ScriptLineNumber) ;@ScriptLineNumber does not work when compiled :( if Not $Notify_Assert_Error Then Return Elseif Not $test Then if MsgBox(16 + 4, "Assertion error @ " & $line,"An assertion error have accured, would like to stop the script?" & @CRLF & _ "Press 'Yes' to exit or press 'No' to ignore the error") = 6 Then Exit EndIf EndIf EndFunc [font="Impact"]Never fear, I is here.[/font] Link to comment Share on other sites More sharing options...
ResNullius Posted February 5, 2009 Share Posted February 5, 2009 Similar (earlier) idea by Uten http://www.autoitscript.com/forum/index.ph...st&p=359561 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