home *** CD-ROM | disk | FTP | other *** search
- program Health;
-
- { Health Copyright (c) Richard F. Griffin
-
- 8 January 1990
-
- 102 Molded Stone Pl
- Warner Robins, GA 31088
-
- This test routine reads two dBase files, using index and memo files.
- It first reads file HLTHDATA.DBF, indexed on HLTHDATA.NDX.
- using field F_CODE, it finds the matching record in HEALTH.DBF,
- indexing on FOODCODE.NDX. Data, including memo fields for some records,
- is displayed on the screen.
-
- The records will be displayed one at a time. Press RETURN when
- ready for the next record.
-
- The capability to handle multiple files, along with memo and index
- files, is demonstrated here.
-
- }
-
- uses CRT, Dos, GS_DBASE, GS_DB_FL, Hlth_Unt, HlthData;
- var
- i, j : integer;
- val : string[10];
- inp : string[40];
- begin
- clrscr;
- Hlth_Unt_r.open;
- Hlth_Unt_r.index('FOODCODE');
- Hlth_Unt_r.comments.memo_width := 40;
- HlthData_r.open;
- HlthData_r.Index('HLTHDATA');
- with HlthData_r do
- begin
- GetRec(Top_Record);
- while not File_EOF do
- begin
- str(F_Code.getfield,val);
- Hlth_Unt_r.Find(val);
- writeln(L_Name.getfield,' ',F_Code.getfield,
- ' ',Hlth_Unt_r.Food.getfield,' ',M_Date.getfield);
- inp := Hlth_Unt_r.Comments.GetField;
- for i := 1 to Hlth_Unt_r.Comments.Memo_Lines do
- writeln(Hlth_Unt_r.comments.GetMemo(i));
- readln(inp);
- GetRec(Next_Record);
- end;
- str(F_Code.getfield,val);
- Hlth_Unt_r.Find(val);
- writeln(L_Name.getfield,' ',F_Code.getfield,
- ' ',Hlth_Unt_r.Food.getfield,' ',M_Date.getfield);
- inp := Hlth_Unt_r.Comments.GetField;
- for i := 1 to Hlth_Unt_r.Comments.Memo_Lines do
- writeln(Hlth_Unt_r.comments.GetMemo(i));
- readln(inp);
- end;
- Hlth_Unt_r.close;
- end.