home *** CD-ROM | disk | FTP | other *** search
- program DemoE006;
- {------------------------------------------------------------------------------
- DBase List Selector
- Expanded Sample 6
- Demo Program
-
- Copyright (c) Richard F. Griffin
-
- 10 February 1992
-
- 102 Molded Stone Pl
- Warner Robins, GA 31088
-
- -------------------------------------------------------------
- Use GS_DBTBL.PAS object dBTbl_Pick_Obj to select a record from a
- list, then display/edit all record fields on-screen.
-
- ********** Not For Use in a TurboVision Environment **********
-
- If it does not already exist, the DEMOE6.DBF file will be created
- by using the MakeTestData procedure in GS_GENF.PAS.
-
- A scrollable list of all LASTNAME fields will be displayed. When
- one is selected, then all fields in the dBase record will be
- displayed on-screen using the FieldUpdateScreen procedure in
- GS_dBFld_Objt. All fields may be edited and the record will be
- updated. The memo record may also be viewed and modified.
-
- The list is created by Pick_dBTabl. It will read the dBase file
- and build a list of LASTNAME elements. The list is only built once
- and is displayed each time afterwards until it is reset to empty.
- Notice that if LASTNAME is changed, the list entry must be
- changed. To do this, Reset_dBTabl is called. Since the only thing
- we know for sure is that RecChanged is true, we reset the list any
- time a record is written.
-
- -------------------------------------------------------------------------------}
-
-
- uses
- CRT,
- DOS,
- GS_KeyI,
- GS_FileH,
- GS_dBFld,
- GS_dBTbl,
- GS_dBase,
- GS_GenF;
-
- var
- MyFile : GS_dBFld_Objt;
- FileTab : dbTabl_Pick_Obj;
- CkFile : file;
-
- begin
- ClrScr;
- if not GS_FileExists(CkFile,'DEMOE6.DBF') then
- begin
- writeln('Creating DEMOE6.DBF');
- MakeTestData('DEMOE6', 20, true);
- writeln('DEMOE6.DBF Created');
- ClrScr;
- end;
- MyFile.Init('DEMOE6');
- MyFile.Open;
- FileTab.Init_dbTabl(MyFile, '[ LASTNAME ]',20,2,60,22,
- Yellow,Blue,LightGray,Blue,LightGray);
- while FileTab.Pick_dBTabl('LASTNAME') do
- begin
- while MyFile.FieldUpdateScreen do
- begin
- if MyFile.RecChanged then
- begin
- MyFile.PutRec(MyFile.RecNumber);
- FileTab.Reset_dBTabl;
- end;
- if GS_KeyI_Chr = Kbd_PgUp then
- MyFile.GetRec(Prev_Record)
- else
- MyFile.GetRec(Next_Record);
- end;
- end;
- MyFile.Close;
- end.
-