(* Collection of code snippets by Arne Vajhøj *)
(* (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) *)
program insert_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);
   a.id := 4;
   a.description := 'Blue truck';
   a.assettype := TRUCK;
   a.model := 'Ford F-250';
   a.license := 'CD5678';
   a.towcapacity := 10000;
   db^ := a;
   put(db);
   a.id := 5;
   a.description := 'Large trailer';
   a.assettype := TRAILER;
   a.ownweight := 1000;
   a.maxcargo := 6000;
   a.roof := PERMOPEN;
   db^ := a;
   put(db);
   a.id := 6;
   a.description := 'Lawn tractor #2';
   a.assettype := TOOL;
   a.tooltype := 'Lawn tractor';
   a.name := 'Craftsman';
   a.weight := 1000;
   db^ := a;
   put(db);
   close(db);
end.
