[Implemented] Clear Debug Window
-
- Enthusiast
- Posts: 613
- Joined: Tue May 06, 2003 2:50 pm
- Location: Germany
- Contact:
[Implemented] Clear Debug Window
I'm asking for a possibilty to clear the debug output window with
a) a command (like DebugClear)
b) a button within the window itself
(See 'ClearDebugOutput()')
a) a command (like DebugClear)
b) a button within the window itself
(See 'ClearDebugOutput()')
-
- Enthusiast
- Posts: 423
- Joined: Fri Apr 25, 2003 5:22 pm
- Contact:
-
- Enthusiast
- Posts: 613
- Joined: Tue May 06, 2003 2:50 pm
- Location: Germany
- Contact:
-
- User
- Posts: 14
- Joined: Sun Dec 14, 2003 4:57 am
- Location: Wichita, Kansas
- Contact:
Re: Clear Debug Window
Good Idea.freedimension wrote:I'm asking for a possibilty to clear the debug output window with
a) a command (like DebugClear)
Fred should add it directly to the debugger, but here a
workaround because you dont know if Fred wants to add it.

Code: Select all
;
; by Danilo, 14.12.2003 - english forum
;
Procedure DebugClear_Callback(hWnd,Value)
result = 1
ClassName$ = Space(100)
GetClassName_(hWnd,@ClassName$,100)
If ClassName$ = "ListBox"
Count = SendMessage_(hWnd,#LB_GETCOUNT,0,0)
If Count > 0
SendMessage_(hWnd,#WM_SETREDRAW,0,0)
For a = 0 To Count - 1
SendMessage_(hWnd,#LB_DELETESTRING,0,0)
Next a
SendMessage_(hWnd,#WM_SETREDRAW,1,0)
InvalidateRect_(hWnd,0,1)
EndIf
result = 0
EndIf
ProcedureReturn result
EndProcedure
Procedure DebugClear()
hDebug = FindWindow_(0,"PureBasic - Debug Output")
If hDebug
EnumChildWindows_(hDebug,@DebugClear_Callback(),0)
; Else
; MessageRequester("DEBUG CLEAR","Debugger Disabled!",#MB_ICONERROR)
EndIf
EndProcedure
For a = 1 To 100
Debug Str(a)
Next a
Delay(1000)
DebugClear()
Debug 12
Remember my old code to save debug output?
Still not added to the PB Debugger...

Code: Select all
Procedure SaveDebugTextCallback(hWnd,Value)
ClassName$ = Space(100)
GetClassName_(hWnd,@ClassName$,100)
If ClassName$ = "ListBox"
Count = SendMessage_(hWnd,#LB_GETCOUNT,0,0)
If Count = 0
MessageRequester("DEBUG SAVE","No Data in Debug Output",#MB_ICONINFORMATION)
Else
If OpenFile(1,PeekS(Value))
FileSeek(Lof())
WriteStringN(";---[ New Entry ]-------")
GetLocalTime_(time.SYSTEMTIME)
WriteStringN("; - Date: "+StrU(time\wDay,1)+"."+StrU(time\wMonth,1)+"."+StrU(time\wYear,1))
WriteStringN("; - Time: "+StrU(time\wHour,1)+":"+StrU(time\wMinute,1))
For a = 0 To Count - 1
Length = SendMessage_(hWnd,#LB_GETTEXTLEN,a,0)
Text$ = Space(Length)
SendMessage_(hWnd,#LB_GETTEXT,a,@Text$)
WriteStringN(" | "+Text$)
Next a
WriteStringN(";---[ End Entry ]-------")
WriteStringN("")
CloseFile(1)
MessageRequester("DEBUG SAVE","Saved Debugger Output to:"+Chr(13)+PeekS(Value),#MB_ICONINFORMATION)
Else
MessageRequester("DEBUG SAVE","Couldnt save Debug Output",#MB_ICONERROR)
EndIf
EndIf
EndIf
ProcedureReturn 1
EndProcedure
Procedure SaveDebugOutput(File$)
hDebug = FindWindow_(0,"PureBasic - Debug Output")
If hDebug
EnumChildWindows_(hDebug,@SaveDebugTextCallback(),@File$)
Else
MessageRequester("DEBUG SAVE","Debugger Disabled!",#MB_ICONERROR)
EndIf
EndProcedure
; Code Start
SaveDebugOutput("c:\PB_DEBUG.TXT")
Debug "TEST"
Debug Str(12)+" PureBasic Debug"
Debug "testing..."
Debug 123456
SaveDebugOutput("c:\PB_DEBUG.TXT")
debug windows. Users requested this long long time ago,
but somebody doesnt seem to care about it...
Re: Clear Debug Window
i cannot remember the meaning of lazyness.........Danilo wrote:....but somebody doesnt seem to care about it...
SPAMINATOR NR.1
Re: Clear Debug Window
yes, me also can't remember what lazy means....mmmmRings wrote:i cannot remember the meaning of lazyness.........Danilo wrote:....but somebody doesnt seem to care about it...