Jump to content

Debug Window


EagleTG
 Share

Recommended Posts

I've created the following for the scripts I write. It helps me tremendously when writing AutoIt scripts. There might be a better/easier way, not sure. Kind-of a newbie at AutoIt.

#include <GUIConstants.au3>

Dim $dbg

GuiCreate ("Debug Window",500,75,0,0,"",$WS_EX_TOPMOST)
GuiSetState (@SW_SHOW)

Func Debug($dbg)
     GuiCtrlCreateLabel ($dbg & "                                                                  ",10,10)
    ;Sleep(1000)
EndFunc

Debug ("Nothing to report")

It creates a window, top-left of the screen. Anywhere in your script, you can use Debug("Text Here") and it will update that (always on-top) window to tell you where you are within your script.

Just thought this might help someone. I'm also curious if there are any better ways that people have found of doing something similar? Basically, just to know exactly what your script is doing, etc. For example, if it's waiting for a window with a WinWaitActive and that window never shows up, if you put a Debug("Waiting for Window [window name here]"), it'll give you a checkpoint so you can see where the script got hung-up.

The commented ;Sleep(1000) is a delay so you can see each step of lines that run by too quickly.

Enjoy!

Link to comment
Share on other sites

  • Developers

consolewrite.

ConsoleWrite() will only work when you shell your AutoIt script from it and your editor supports reading the output produced.

Not everybody is using the SciTE4AutoIt3 setup.

@EagleTG: You might want to have a look at SciTE4AutoIt3 and the Debug Scripts it includes. B)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

JdeB: SciTE4AutoIt3 looks totally awesome. I'm digging into that right now. I've got it installed, and am settling in. Thanks for that tip... I've been trolling the forums for a while, how did I EVER miss this?!!

SlimShady: Thanks a million, yours looks awesome. Very nice... I never thought to use a Textbox so I could have a history... :doh!:

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...