Package DirTest

Uses
    KbdCRT,Error,Partition,Dir

Sub WriteChar(C as Byte)
Enter
  AX=&H0E00|C
  InLine &H10CD
Leave

Var
   D as DirEntry
   Buf as Array[0..2048] Of Byte
   N,I as Word
   Len as LongWord
Enter
  ClearScreen
  SetDrive &H80
  Len=0
  ChDir("RESERVE ","   ")
  ChDir("PROJSYS ","   ")
  If FindFile(D,"TRANS   ","C  ")=0 Then Error("Not Found");
  PrintDirEntry D
  PrintCR
  N=D.First
  Buf[2048]='ê'
  While N & FATMask<>FATMask Do
    ReadCluster(Buf,N-2)
    For I=0 To SizeCluster-1 Do
    Begin
      If Buf[I]='	' Then PrintS "        "
      Else
      If Buf[I]=&H0A Then PrintCR
      Else
      If Buf[I]=&H0D Then I+=1:Len+=1:PrintCR Else PutCar Buf[I];
      Len+=1
      If Len=D.Size Then I=SizeCluster-1;
    Next
    N=FATNext(N)
  Wend
  WriteChar Buf[2048]
Leave