home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / top2src.zip / TOPLINK.ZIP / TOPTEST2.PAS < prev    next >
Pascal/Delphi Source File  |  1994-05-28  |  1KB  |  54 lines

  1. Program RAPLink;
  2.  
  3. Const
  4.    fmReadOnly  = $00;  (* *)
  5.    fmWriteOnly = $01;  (* Only one of these should be used *)
  6.    fmReadWrite = $02;  (* *)
  7.  
  8.    fmDenyAll   = $10;  (* together With only one of these  *)
  9.    fmDenyWrite = $20;  (* *)
  10.    fmDenyRead  = $30;  (* *)
  11.    fmDenyNone  = $40;  (* *)
  12.  
  13. Type
  14.   IDXRec = Record
  15.              Alias : String[30];
  16.              Name : String[42];
  17.              Location : String[30];
  18.              Buf : Array [1..407] of byte;
  19.            end;
  20.  
  21. Var
  22.   IDXFile : File of IDXRec;
  23.   IDXBlock : IDXRec;
  24.  
  25. Procedure WriteCString (var str; len : byte);
  26. Var
  27.   s : string absolute str;
  28.   l : byte;
  29. begin
  30.   l := 0;
  31.   While (s[l] <> #0) and (l <= len) do
  32.   begin
  33.     Write (s[l]);
  34.     Inc (l);
  35.   end;
  36.   Writeln;
  37. end;
  38.  
  39. Var
  40.   L : byte;
  41.   F : File of byte;
  42.  
  43. begin
  44.   Writeln (SizeOf (IDXBlock));
  45.   FileMode:=fmReadWrite+FmDenyNone;
  46.   Assign (IDXFile, 'd:\nodeidx.rap');
  47.   Reset (IDXFile);
  48.   Seek (IDXFile, 8);
  49.   Read (IDXFile, IDXBlock);
  50.   WriteCString (IDXBlock.Alias, 30);
  51.   WriteCString (IDXBlock.Name, 30);
  52.   WriteCString (IDXBlock.Location,30);
  53. end.
  54.