program DB_Xpl09;
uses
   CRT,
   DOS,
   GS_dBFld,
   GS_dBase;
var
   Health  : GS_dBFld_Objt;

begin
   ClrScr;
   Health.Init('HEALTH');
   Health.Open;
   Health.IndexTo('FOODCODE','FOOD_CODE');
                                    {Create an index.  Use field FOOD_CODE}
                                    {and create a .NDX file named FOODCODE}

   Health.Index('FOODCODE');        {Use Index FOODCODE.NDX}
   Health.GetRec(Top_Record);
   while not Health.File_EOF do
   begin
      writeln(Health.FieldGet('FOOD'),'   ',
              Health.FieldGet('CALS'),'   (',
              Health.FieldGet('FOOD_CODE'),')');
      Health.GetRec(Next_Record);
   end;
   Health.Close;
end.
