Jump to content
Sign in to follow this  

A simple debug display

Recommended Posts

The other day I asked for some example code so I could gen up a logging window. Kourath replied with a very nice working example. I am lazy and I get tired of typing MsgBox and its three fields all the time and I usually don't want to stop the program and click OK to get going again. So I took his nice example, butchered it and set it up whereby I don't even need to call an initialization routine and stuck it in my standard include file.

It is cheesy, simple, and cheap but it helps a little. It has probably been done b4 but here it is anyway. I used some long global names to avoid conflicts. Maybe you have some ideas about how to clean it up a bit. It could probably use some option parms to set the size but then that would be more globals. Or maybe a param for having it pause the program...




#include <GUIConstants.au3>

Func display($string)

Global $debugDisplayExists

if $debugDisplayExists <> 1 Then

Opt("GUIOnEventMode", 1)

Global $debugDisplay_GUI = GUICreate("AutoIt Debug Display", 385, 395, 258, 190)

Global $debugDisplay_Edit = GUICtrlCreateEdit("", 8, 8, 369, 377, BitOR($ES_AUTOVSCROLL,$ES_READONLY,$ES_WANTRETURN,$WS_VSCROLL))


$debugDisplayExists = 1


GUICtrlSetData($debugDisplay_Edit, $string &@CRLF, 1)


;Test it

display("testing display")

MsgBox(0,"", "between calls")

display("testing display again")

MsgBox(0,"", "Done")

Share this post

Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...