home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
PASCAL
/
TCSEL002
/
FILESTR.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-10-16
|
1KB
|
58 lines
{$B-,D-,F-,I-,L-,N-,O-,R-,S-,V-}
unit filestr;
interface
uses dos;
function GetFstr(var f: text): string;
procedure OpenFStr(var f: text);
implementation
var
FStrBuff : string;
function GetFStr(var f: text): string;
begin
GetFStr := FStrBuff;
FStrBuff[0] := #0;
TextRec(f).BufPos := 0;
end; { GetFStr }
{$F+}
function FStrOpen(var f: TextRec):word;
{ This does nothing except return zero to indicate success }
begin
FStrOpen := 0;
end; { FStrOpen }
function FStrInOut(var f: TextRec):word;
begin
FStrBuff[0] := chr(F.BufPos);
FStrInOut := 0;
end; { FStrInOut }
{$F-}
procedure OpenFStr(var f: text);
begin
with TextRec(f) do begin
mode := fmClosed;
BufSize := Sizeof(buffer);
OpenFunc := @FStrOpen;
InOutFunc := @FStrInOut;
FlushFunc := @FStrInOut;
CloseFunc := @FStrOpen;
BufPos := 0;
BufEnd := 0;
BufPtr := @FStrBuff[1];
Name[0] := #0;
end; { with }
FStrBuff[0] := #0;
rewrite(f);
end; { AssignFStr }
end.