home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / PASCAL / PASTUT34 / DEBUGPTH.TXT < prev    next >
Text File  |  1993-03-17  |  2KB  |  55 lines

  1.     Modification to Procedure MemoryCheck in the program HeapList.pas
  2.     and to the Procedure DosDebug in the program TwoLinks.pas
  3.     -----------------------------------------------------------------
  4.  
  5. The function DebugPath searches for DEBUG.EXE and if not found then
  6. searches for DEBUG.COM. Use is made of the Turbo Pascal functions
  7. FSearch and GetEnv and the resultant DebugPath, of type Pathstr, is
  8. passed to the Exec call of the procedure MemoryCheck (or DosDebug).
  9.  
  10. The new code is shown below:
  11.  
  12.  
  13. Procedure MemoryCheck;
  14.  
  15. Function DebugPath : Pathstr;
  16.  
  17. var
  18.   DPath : PathStr;
  19.  
  20. begin
  21.   DPath := '';
  22.   DPath := FSearch('DEBUG.EXE', GetEnv('PATH'));
  23.   If DPath = '' then DPath := FSearch('DEBUG.COM', GetEnv('PATH'));
  24.   If DPath = '' then
  25.      begin
  26.         writeln('DEBUG file not found. Please check your DOS system.');
  27.         writeln;
  28.         writeln('Press any key to continue: ');
  29.         repeat until keypressed;
  30.      end;
  31.   DebugPath := DPath;
  32. end;      {of Function DebugPath}
  33.  
  34.  
  35. begin
  36.    writeln('Please wait for prompt (-) of DOS Debug, now being called by Exec procedure.');
  37.    writeln('Then type D followed by a space and then the HeapOrg address (above) and ENTER.');
  38.    writeln('Finally, after studying the contents of memory, type Q and press ENTER to quit.');
  39.    writeln;
  40.    SwapVectors;
  41.    Exec(DebugPath,'');
  42.    If DosError <> 0 then writeln('Dos error # ',DosError);
  43.    SwapVectors;
  44. end;
  45.     --------------------------------------------------------------
  46.  
  47. The same function DebugPath is used in the program TwoLinks.pas, but
  48. here it is included in the procedure DosDebug, which was the name used
  49. in place of MemoryCheck in TwoLinks.pas.
  50.  
  51.  
  52.  
  53. R Shaw
  54. 17.3.93
  55.