AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

debugmsgbox(...) function

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
apocalypse~r



Joined: 21 Jun 2007
Posts: 24

PostPosted: Tue Mar 11, 2008 10:54 pm    Post subject: debugmsgbox(...) function Reply with quote

a helpful function.
since we all know that when we are debuging a script that handles lots of numbers and such, and something manages to go spectacularly wrong, we fill the script with messageboxes to figure out where the error is occurring. introducing: debugmsgbox(...). in the beginning of your script, add this function. then somewhere in the autoexecute section, define a_debugmsgbox as 1 or 0. if its 0, msgboxes wont show. if its 1, they will.

Code:
debugmsgbox(title = "", text = "Press OK to Continue.", timeout = "")
{
  global a_debugmsgbox
  if not a_debugmsgbox
    return
  msgbox, 0, %title%, %text%, %timeout%
}

_________________
problems := bugs + errors + glitches
code := (problems != 0) ? debug(code) : celebrate()
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group