home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-11-27 | 1.4 KB | 77 lines | [TEXT/PJMM] |
- unit FakeParameters;
-
- interface
-
- uses
- Lists, MyFileSystem;
-
- procedure InitAppFilesX;
- procedure GetAppFilesX (index: integer; var theFile: appFile);
- procedure CountAppFilesX (var message, count: integer);
- procedure ClrAppFilesX (index: integer);
-
- implementation
-
- type
- appFilePtr = ^appFile;
- appFileHandle = ^appFilePtr;
-
- var
- lh: listHeadHandle;
- cnt: integer;
-
- procedure InitAppFilesX;
- var
- typeList: SFtypeList;
- reply: SFreply;
- afh: appFileHandle;
- begin
- cnt := 0;
- CreateList(lh);
- GetFile(-1, typeList, reply);
- while reply.good do begin
- afh := appFileHandle(NewHandle(SizeOf(appFile)));
- afh^^.vRefNum := reply.vRefNum;
- afh^^.fType := reply.fType;
- afh^^.versNum := 0;
- afh^^.fName := reply.fName;
- AddTail(lh, afh);
- cnt := cnt + 1;
- GetFile(-1, typeList, reply);
- end;
- end;
-
- procedure GetAppFilesX (index: integer; var theFile: appFile);
- var
- lp: listHandle;
- afh: appFileHandle;
- begin
- if index > cnt then
- with theFile do begin
- vRefNum := 32000;
- fType := OSType(0);
- versNum := $FF;
- fName := '';
- end
- else begin
- ReturnHead(lh, lp);
- while index > 1 do begin
- MoveToNext(lp);
- index := index - 1;
- end;
- Fetch(lp, afh);
- theFile := afh^^;
- end;
- end;
-
- procedure CountAppFilesX (var message, count: integer);
- begin
- message := appOpen;
- count := cnt;
- end;
-
- procedure ClrAppFilesX (index: integer);
- begin
- end;
-
- end.