home *** CD-ROM | disk | FTP | other *** search
- {
- ════════════════════════════════════════════════════════════════════════════
-
- Visionix DEBUG Unit
- Version 0.13
- Copyright 1991,92,93 Visionix
- ALL RIGHTS RESERVED
-
- ────────────────────────────────────────────────────────────────────────────
-
- Revision history in reverse chronological order:
-
- Initials Date Comment
- ──────── ──────── ────────────────────────────────────────────────────────
-
- jrt 11/15/93 First logged version.
-
- --------------------------------------------------------------------------
-
- ════════════════════════════════════════════════════════════════════════════
- }
-
- (*-
-
- [TEXT]
-
- <Overview>
-
- This unit provides a simple set a functions which can be used to debug
- a program. It provides functions to write "information" lines to a
- specified text file.
-
-
- -*)
-
- Unit VDebugu;
-
- Interface
-
- Uses
-
- DOS;
-
- (*-
-
- [TEXT]
-
- <About this unit>
-
- This unit provides a simple set a functions which can be used to debug
- a program. It provides functions to write "information" lines to a
- specified text file.
-
-
-
- -*)
-
-
- Var
-
- DebugFile : TEXT;
- DebugStr : STRING;
- DebugLvl : WORD;
-
-
-
- Procedure DebugOpen( FName : STRING );
- Procedure DebugFlush;
- Procedure DebugClose;
-
- Procedure DebugBegin;
- Procedure DebugEnd;
-
- Procedure DebugWrite( S : STRING );
- Procedure DebugWriteLn( S : STRING );
-
-
- {────────────────────────────────────────────────────────────────────────────}
-
-
- Implementation
-
-
-
-
- {────────────────────────────────────────────────────────────────────────────}
-
- Procedure DebugOpen( FName : STRING );
-
- Var
-
- err : word;
-
- BEGIN
-
- Assign( DebugFile, FName );
- Rewrite( DebugFile );
-
- DebugStr := '';
-
- DebugLvl := 0;
-
- END;
-
- {────────────────────────────────────────────────────────────────────────────}
-
- Procedure DebugFlush;
-
- BEGIN
-
- Flush( DebugFile );
-
- END;
-
- {────────────────────────────────────────────────────────────────────────────}
-
- Procedure DebugClose;
-
- BEGIN
-
- Close( DebugFile );
-
- END;
-
- {────────────────────────────────────────────────────────────────────────────}
-
- Procedure DebugBegin;
-
- BEGIN
-
- Inc( DebugLvl );
-
- DebugStr := DebugStr + ' ';
-
- END;
-
- {────────────────────────────────────────────────────────────────────────────}
-
- Procedure DebugEnd;
-
- BEGIN
- If DebugLvl>0 Then
- BEGIN
- Dec( DebugLvl );
- DebugStr := Copy( DebugStr, 1, Length(DebugStr)-2 );
- END;
- END;
-
- {────────────────────────────────────────────────────────────────────────────}
-
- Procedure DebugWrite( S : STRING );
-
- BEGIN
-
- Write( DebugFile, DebugStr+S );
- Close( DebugFile);
- Append( DebugFile );
-
- END;
-
- {────────────────────────────────────────────────────────────────────────────}
-
- Procedure DebugWriteLn( S : STRING );
-
- BEGIN
-
- WriteLn( DebugFile, DebugStr+S );
- Close( DebugFile);
- Append( DebugFile );
-
-
- END;
-
- {────────────────────────────────────────────────────────────────────────────}
- {────────────────────────────────────────────────────────────────────────────}
- {────────────────────────────────────────────────────────────────────────────}
-
-
- BEGIN
-
-
- END.
-
-