home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 2 BBS
/
02-BBS.zip
/
MFMP110A.ZIP
/
MAXAREAS.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-03-09
|
2KB
|
73 lines
(*#module(turbo_comp=>off)*)
Implementation Unit MaxAreas;
IMPORT
OS2DEF(ULONG),
DOS(HDIR,FILEFINDBUF,HDIR_CREATE,EXIT_PROCESS),
TURBOCRT,
TURBODOS,
TURBOSYS(_BLOCKREAD);
Var
xztempstr : array[1..255] of char;
xhndlhdir : HDIR;
xattr, xreslng, xcount, xretn : word;
xrsrvd : ULONG;
xDirInfo : FILEFINDBUF;
AreaDat : FILE OF char;
{========================================================================}
Procedure OpenMaximusArea;
Var
iores : word;
Begin
xattr := 0H;
xhndlhdir := HDIR_CREATE;
xcount := 1;
xreslng := size(FILEFINDBUF);
StrToZ(AreaPath,xztempstr);
xretn := dos.FindFirst(xztempstr,xhndlhdir,xattr,xDirInfo,
xreslng,xcount,xrsrvd);
If xretn <> 0 Then
Begin
WriteLn(AreaPath+' not found!');
dos.exit(EXIT_PROCESS,1);
{ ABORT(1); }
End
Else
Begin
IOcheck := FALSE;
Assign(AreaDat,AreaPath);
iores := IOresult;
FileMode := 0H;
iores := IOresult;
Reset(AreaDat);
iores := IOresult;
Seek(AreaDat,4);
iores := IOresult;
_BLOCKREAD(AreaDat,StructLen,Size(StructLen));
iores := IOresult;
IOcheck := TRUE;
End;
End;
{========================================================================}
Function GetMaximusArea { (AreaNo, StructLen : Integer; Var AreaRecord : AreaRecordType) : Byte; };
Begin
If (StructLen*AreaNo) > FileSize(AreaDat) Then
Begin
GetMaximusArea := 254;
End
Else
Begin
Seek(AreaDat,StructLen*(AreaNo-1));
_BLOCKREAD(AreaDat,AreaRecord,Size(AreaRecord));
GetMaximusArea := 0;
End;
End;
{========================================================================}
Procedure CloseMaximusArea;
Begin
Close(AreaDat);
End;
{========================================================================}
End.