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 >
Wrap
Text File
|
1993-03-17
|
2KB
|
55 lines
Modification to Procedure MemoryCheck in the program HeapList.pas
and to the Procedure DosDebug in the program TwoLinks.pas
-----------------------------------------------------------------
The function DebugPath searches for DEBUG.EXE and if not found then
searches for DEBUG.COM. Use is made of the Turbo Pascal functions
FSearch and GetEnv and the resultant DebugPath, of type Pathstr, is
passed to the Exec call of the procedure MemoryCheck (or DosDebug).
The new code is shown below:
Procedure MemoryCheck;
Function DebugPath : Pathstr;
var
DPath : PathStr;
begin
DPath := '';
DPath := FSearch('DEBUG.EXE', GetEnv('PATH'));
If DPath = '' then DPath := FSearch('DEBUG.COM', GetEnv('PATH'));
If DPath = '' then
begin
writeln('DEBUG file not found. Please check your DOS system.');
writeln;
writeln('Press any key to continue: ');
repeat until keypressed;
end;
DebugPath := DPath;
end; {of Function DebugPath}
begin
writeln('Please wait for prompt (-) of DOS Debug, now being called by Exec procedure.');
writeln('Then type D followed by a space and then the HeapOrg address (above) and ENTER.');
writeln('Finally, after studying the contents of memory, type Q and press ENTER to quit.');
writeln;
SwapVectors;
Exec(DebugPath,'');
If DosError <> 0 then writeln('Dos error # ',DosError);
SwapVectors;
end;
--------------------------------------------------------------
The same function DebugPath is used in the program TwoLinks.pas, but
here it is included in the procedure DosDebug, which was the name used
in place of MemoryCheck in TwoLinks.pas.
R Shaw
17.3.93