home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / GSDBASE.ZIP / HEALTH.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1990-01-08  |  1.9 KB  |  61 lines

  1. program Health;
  2.  
  3. {      Health Copyright (c)  Richard F. Griffin
  4.  
  5.        8 January 1990
  6.  
  7.        102 Molded Stone Pl
  8.        Warner Robins, GA  31088
  9.  
  10.    This test routine reads two dBase files, using index and memo files.
  11.    It first reads file HLTHDATA.DBF, indexed on HLTHDATA.NDX.
  12.    using field F_CODE, it finds the matching record in HEALTH.DBF,
  13.    indexing on FOODCODE.NDX.  Data, including memo fields for some records,
  14.    is displayed on the screen.
  15.  
  16.    The records will be displayed one at a time.  Press RETURN when
  17.    ready for the next record.
  18.  
  19.    The capability to handle multiple files, along with memo and index
  20.    files, is demonstrated here.
  21.  
  22. }
  23.  
  24. uses CRT, Dos, GS_DBASE, GS_DB_FL, Hlth_Unt, HlthData;
  25. var
  26.    i, j : integer;
  27.    val : string[10];
  28.    inp : string[40];
  29. begin
  30.    clrscr;
  31.    Hlth_Unt_r.open;
  32.    Hlth_Unt_r.index('FOODCODE');
  33.    Hlth_Unt_r.comments.memo_width := 40;
  34.    HlthData_r.open;
  35.    HlthData_r.Index('HLTHDATA');
  36.    with HlthData_r do
  37.    begin
  38.       GetRec(Top_Record);
  39.       while not File_EOF do
  40.       begin
  41.          str(F_Code.getfield,val);
  42.          Hlth_Unt_r.Find(val);
  43.          writeln(L_Name.getfield,'   ',F_Code.getfield,
  44.                  '   ',Hlth_Unt_r.Food.getfield,'   ',M_Date.getfield);
  45.          inp := Hlth_Unt_r.Comments.GetField;
  46.          for i := 1 to Hlth_Unt_r.Comments.Memo_Lines do
  47.             writeln(Hlth_Unt_r.comments.GetMemo(i));
  48.          readln(inp);
  49.          GetRec(Next_Record);
  50.       end;
  51.       str(F_Code.getfield,val);
  52.       Hlth_Unt_r.Find(val);
  53.       writeln(L_Name.getfield,'   ',F_Code.getfield,
  54.               '   ',Hlth_Unt_r.Food.getfield,'   ',M_Date.getfield);
  55.       inp := Hlth_Unt_r.Comments.GetField;
  56.       for i := 1 to Hlth_Unt_r.Comments.Memo_Lines do
  57.          writeln(Hlth_Unt_r.comments.GetMemo(i));
  58.       readln(inp);
  59.    end;
  60.    Hlth_Unt_r.close;
  61. end.