n3ss3s
2008-01-24 09:23:26
procedure ClearDebug;
Clears debug box.
procedure DeleteDebugLine(Line: Integer);
Deletes a line from the debug box.
function GetDebugLineCount: Integer;
Get the number of lines in the debug box.
function GetDebugText: string;
Gets the text in the debugbox.
function GetDebugLine(Line: Integer): string;
Returns a certain given line of the debug box.
procedure ClearDebugLine(Line: Integer);
Clears a certain line of the debug box.
procedure ReplaceDebugLine(Line: Integer; s: string);
Replaces a certain line of the debug box.
We don't have a preserved array of string of the debug box line, but, we do have the line numbers ;)
GetDebugLineCount is your friend.
Finding a string in debug box and returning its line -
Function GetLineOf(S: String): Integer;
Var
C: Integer;
Begin
C := GetDebugLineCount;
For Result := 0 To C Do
If Pos(S, GetDebugLine(Result)) <> 0 Then
Exit;
End;
And you also see how to use a for loop without having to type Var and all the other stuff :)
The Result variable goes through all the debug lines, and when it's found the one you want, it exits the procedure. Voila.
function GetDebugText: string;
Gets the text in the debugbox.It gets the WHOLE text of the debug box, it might not be something you really want to use.
BUT, it has this useful priority that it puts some space between the lines in the result, so, you can quickly split the whole debug box to a string array :)
procedure DeleteDebugLine(Line: Integer);
Deletes a line from the debug box.To be used with something like the GetLineOf that I made above, for example if you don't like the way that AutoColor functions spit out the result - "RockColor =.." you can just use these to delete them all from your debug box :)
procedure ReplaceDebugLine(Line: Integer; s: string);
Replaces a certain line of the debug box. Replaces a certain line of the debug box. :p
procedure ClearDebug;
Clears debug box.Clears the whole debug box.
procedure ClearDebugLine(Line: Integer);
Clears a certain line of the debug box. Freddy had obviously worked himself too tired, the same as deleting a line.
Very small tut, but hope it helped you…