home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
cprog
/
blx21.zip
/
OV2DLL.ARJ
/
TXTDLL.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1992-05-28
|
794b
|
38 lines
Library TxtDLL;
uses Strings, WinProcs, WinTypes;
function GetAString(FileName: PChar; Buffer:PChar): PChar; export;
var
f: file;
SizeOfFile: integer;
Buf: array[0..4095] of byte;
begin
assign(f, filename);
{$I-}
reset(f,1);
{$I+}
if IOResult <> 0 then
begin
GetAString:=#0;;
Exit;
end;
SizeOfFile := filesize(f);
{$I-} {I/O Checking off}
BlockRead(f, buf, 4095);
{$I+} {I/O Checking on}
if IOResult<>0 then; {Dump any IO error}
if SizeOfFile<4095 then
Buf[SizeOfFile]:=0
else
buf[4095]:=0;
Close(f);
StrCopy(buffer,@buf); { copy the stored value into the passed buf parameter }
GetAString := buffer; { pass the value as a return value as well }
end;
exports GetAString index 1;
begin
end.