Sign in to follow this  
Followers 0
hmsSurprise

A simple debug display

1 post in this topic

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

Regards,

jh

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#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))

GUISetState(@SW_SHOW)

$debugDisplayExists = 1

EndIf

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

EndFunc

;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  
Followers 0