(* Collection of code snippets by Arne Vajhøj *)
(* (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) *)
program list_before_2(input, output);

%include 'asset_isam.pas'

var
   a : asset;
   db : file of asset;

begin
   open(db, 'asset.isq', unknown, organization := indexed, access_method := keyed);
   resetk(db, 0);
   while not eof(db) do begin
      a := db^;
      write(a.id, ' ', a.description, ' ');
      case a.assettype of
         TRUCK:
            begin
               write(a.model, ' ', a.license, ' ', a.towcapacity);
            end;
         TRAILER:
            begin
               write(a.ownweight, ' ', a.maxcargo, ' ', a.roof);
            end;
         TOOL:
            begin
               write(a.tooltype, ' ', a.name, ' ', a.weight);
            end;
      end;
      writeln;
      get(db);
   end;
   close(db);
end.
