First one to Clear the window
Second one to save the contant in a text file
Expl:
ClearDebugger()
SaveDebugger(path + File)
Would be helpful... (at least for me

Code: Select all
Procedure GetDebugOutputWindow()
Sleep_(10) ; Short delay seems necessary.
r=GetWindow_(GetDesktopWindow_(),#GW_CHILD)
Repeat
t$=Space(999) : GetWindowText_(r,t$,999)
If Left(t$,15)="Debug Output - "
w=r
Else
r=GetWindow_(r,#GW_HWNDNEXT)
EndIf
Until r=0 Or w<>0
ProcedureReturn w
EndProcedure
Procedure ClearDebugOutput() ; Returns 0 on failure.
d=GetDebugOutputWindow()
If d : s=SendMessage_(FindWindowEx_(d,0,"ListBox",0),#LB_RESETCONTENT,0,0) : EndIf
ProcedureReturn s
EndProcedure
Procedure SaveDebugOutput(file$) ; Returns 0 on failure.
d=GetDebugOutputWindow()
If d And CreateFile(0,file$)
s=1 : l=FindWindowEx_(d,0,"ListBox",0) : n=SendMessage_(l,#LB_GETCOUNT,0,0)
For a=0 To n-1
b=SendMessage_(l,#LB_GETTEXTLEN,a,0) : t$=Space(b)
SendMessage_(l,#LB_GETTEXT,a,@t$) : WriteStringN(0,t$)
Next
CloseFile(0)
EndIf
ProcedureReturn s
EndProcedure
For a=1 To 5 : Debug a : Next
Debug "Clearing in 2 seconds..."
Delay(2000)
ClearDebugOutput()
For a=6 To 10 : Debug a : Next
SaveDebugOutput("c:\debug.txt")
Debug "Saved lines 6 to 10 to c:\debug.txt"
Code: Select all
n=SendMessage_(l,#LB_GETCOUNT,0,0)
It looks like it was written in 2007, using an older version of PureBasic. Someone needs to update it for 2010.Kwaï chang caïne wrote:the function SaveDebugOutput don't works