home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
RBBS in a Box Volume 1 #2
/
RBBS_vol1_no2.iso
/
014r
/
push_pop.zip
/
POP.PAS
next >
Wrap
Pascal/Delphi Source File
|
1985-06-29
|
838b
|
37 lines
{ POP.PAS
By Bela Lubkin 71016,1573
Compile this to a .COM file and put POP.COM somewhere on your PATH. Then
POP will return you to a directory path saved with the PUSH command.
Requires Turbo 3.0 or greater, DOS 2.0 or greater.
}
Const
StackFileName='C:\CDSTACK.DAT'; { Change to whatever seems appropriate }
Type
StackElement=String[66];
Var
S: StackElement;
StackFile: File Of StackElement;
I: Integer;
Begin
Assign(StackFile,StackFileName);
{$I-} Reset(StackFile); {$I+}
If IOResult<>0 Then
Begin
WriteLn('Stack empty');
Halt;
End;
Seek(StackFile,FileSize(StackFile)-1);
Read(StackFile,S);
Seek(StackFile,FileSize(StackFile)-1);
Truncate(StackFile);
I:=FileSize(StackFile);
Close(StackFile);
If I=0 Then Erase(StackFile);
ChDir(S);
End.