Jump to content
shadowrecon

Some new debug procedures

Recommended Posts

Over the past few days i put together some simple but useful procedures for debugging data from variables. This eliminates the repetitive typing of loops to loop out all variables and instead can be done with one line of code and bam you have the info.

UB_Debug.scar

[scar]{===============================================================================

RS2

UB Debug

--------------------------------------------------------------------------------

* Procedure: DebugATPA(ID: AnsiString; ATPA: T2DPointArray; Report: Boolean);

By: ShadowRecon.

* Procedure: DebugTPA(ID: AnsiString; TPA:TPointArray; Report: Boolean);

By: ShadowRecon.

* Procedure: DebugTP(ID: AnsiString; TP: TPoint; Report: Boolean);

By: ShadowRecon.

* Procedure: DebugATIA(ID: AnsiString; ATIA: T2DIntArray; Report: Boolean);

By: ShadowRecon.

* Procedure: DebugTIA(ID: AnsiString; TIA: TIntArray; Report: Boolean);

By: ShadowRecon.

* Procedure: DebugINT(ID: AnsiString; INT: Integer; Report: Boolean);

By: ShadowRecon.

* Procedure: DebugTBA(ID: AnsiString; TBA: TBoxArray; Report: Boolean);

By: ShadowRecon.

* Procedure: DebugTB(ID: AnsiString; TB: TBox; Report: Boolean);

By: ShadowRecon.

* Procedure: DebugSA(ID: AnsiString; SA: TStringArray; Report: Boolean);

By: ShadowRecon.

 

===============================================================================}

 

{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Procedure DebugATPA(ID: AnsiString; ATPA: T2DPointArray; Report: Boolean);

Description: Writeln/AddToReport data from a T2DPointArray.

Contributors: ShadowRecon.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

Procedure DebugATPA(ID: AnsiString; ATPA: T2DPointArray; Report: Boolean);

begin

if Not Report then

Writeln(ID+': '+TPAToStr(MergeATPA(ATPA)))

else

AddToReport(ID+': '+TPAToStr(MergeATPA(ATPA)));

end;

 

{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Procedure DebugTPA(ID: AnsiString; TPA:TPointArray; Report: Boolean);

Description: Writeln/AddToReport data from a TPointArray.

Contributors: ShadowRecon.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

Procedure DebugTPA(ID: AnsiString; TPA:TPointArray; Report: Boolean);

Begin

DebugATPA(ID, [TPA], Report);

end;

 

{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Procedure DebugTP(ID: AnsiString; TP: TPoint; Report: Boolean);

Description: Writeln/AddToReport data from a TPoint.

Contributors: ShadowRecon.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

Procedure DebugTP(ID: AnsiString; TP: TPoint; Report: Boolean);

begin

DebugTPA(ID,[TP],Report);

end;

 

{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Procedure DebugATIA(ID: AnsiString; ATIA: T2DIntArray; Report: Boolean);

Description: Writeln/AddToReport data from a T2DIntArray.

Contributors: ShadowRecon.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

Procedure DebugATIA(ID: AnsiString; ATIA: T2DIntArray; Report: Boolean);

var

I: Integer;

begin

for I := 0 to High(ATIA) do

if Not Report then

WriteLn(ID+': '+TIAToStr(ATIA))

else

AddToReport(ID+': '+TIAToStr(ATIA));

end;

 

{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Procedure DebugTIA(ID: AnsiString; TIA: TIntArray; Report: Boolean);

Description: Writeln/AddToReport data from a TIntArray.

Contributors: ShadowRecon.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

Procedure DebugTIA(ID: AnsiString; TIA: TIntArray; Report: Boolean);

begin

DebugATIA(ID,[TIA],Report);

end;

 

{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Procedure DebugINT(ID: AnsiString; INT: Integer; Report: Boolean);

Description: Writeln/AddToReport data from a TIntArray.

Contributors: ShadowRecon.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

Procedure DebugINT(ID: AnsiString; INT: Integer; Report: Boolean);

begin

DebugTIA(ID,[int],Report);

end;

 

{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Procedure DebugTBA(ID: AnsiString; TBA: TBoxArray; Report: Boolean);

Description: Writeln/AddToReport data from a TBoxArray.

Contributors: ShadowRecon.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

Procedure DebugTBA(ID: AnsiString; TBA: TBoxArray; Report: Boolean);

Var

I: Integer;

begin

For I := 0 to High(TBA) do

if Not Report then

WriteLn(ID+' Pos:'+IntToStr(I)+' Box(' + IntToStr(TBA.x1) + ',' + IntToStr(TBA.y1) + ',' +

IntToStr(TBA.x2) + ',' + IntToStr(TBA.y2) + ');')

else

AddToReport(ID+' Pos:'+IntToStr(I)+' Box(' + IntToStr(TBA.x1) + ',' + IntToStr(TBA.y1) + ',' +

IntToStr(TBA.x2) + ',' + IntToStr(TBA.y2) + ');');

end;

 

{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Procedure DebugTB(ID: AnsiString; TB: TBox; Report: Boolean);

Description: Writeln/AddToReport data from a TBox

Contributors: ShadowRecon.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

Procedure DebugTB(ID: AnsiString; TB: TBox; Report: Boolean);

begin

DebugTBA(ID,[TB],Report);

end;

 

{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Procedure DebugSA(ID: AnsiString; SA: TStringArray; Report: Boolean);

Description: Writeln/AddToReport data from a String Array.

Contributors: ShadowRecon.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}

Procedure DebugSA(ID: AnsiString; SA: TStringArray; Report: Boolean);

begin

if Not Report then

WriteLn(Implode(' ', SA))

else

AddToReport(Implode(' ', SA));

end;[/scar]

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...