home *** CD-ROM | disk | FTP | other *** search
- <<* SIMMAIN.INC *>>
-
- <<procedure ProgramBody( procfile : string )>>
- <<string prgname,fpath,fname,fext>>
- <<begin>>
- <<*---The "program" label returns the current---*>>
- <<*---program filename being generated---*>>
- <<filespec( program,fpath,fname,fext )>>
- <<*---Rebuild the program filename without the PATH---*>>
- <<prgname := fname + '.' + fext>>
- * Program.: {prgname}
- * Author..: {Author}
- * Date....: {date}
- * Notice..: Copyright (c) 1987, {Copyright}, All Rights Reserved
- * Notes...: Simple database application.
- *
- * ---Set environment.
- SET TALK OFF
- SET BELL OFF
- SET SCOREBOARD OFF
- * ---Open procedure file.
- <<filespec( procfile,fpath,fname,fext )>>
- SET PROCEDURE TO {fname}
- *
- * ---Initialize database file.
- SELECT 1
- <<select database 1>>
- <<filespec( dbfnam,fpath,fname,fext )>>
- USE {fname}
- <<if ndxtotal>>
- <<filespec( ndxnam,fpath,fname,fext )>>
- INDEX ON {ndxkey} TO {fname}
- <<endif>>
- *
- * ---Declare PUBLIC memvars to store field values.
- <<forall fldget and (fldtyp $ 'CDLN')>>
- PUBLIC m{fldnam}
- <<endfor>>
- *
- * ---Display screen format.
- DO DispForm
- *
- * ---Main execution loop.
- DO WHILE .T.
- * ---Display record.
- DO DispRec
- * ---Display simple menu.
- choice = " "
- SET COLOR TO {PromptColor}
- @ 24,0 SAY "SELECT: Append Edit Delete Next-Prev-Top-Bottom Quit";
- GET choice PICTURE "!" VALID(choice $ "AEDNPTBQ")
- READ
- DO CASE
- CASE choice ='Q'
- EXIT
- CASE choice ='A'
- * ---Append record.
- DO AddRec
- CASE choice ='E'
- * ---Edit record.
- DO EditRec
- CASE choice ='D'
- * ---Delete record.
- IF .NOT. DELETED()
- DELETE
- ELSE
- RECALL
- ENDIF
- CASE choice ='N'
- * ---Next record.
- SKIP
- IF EOF()
- GOTO BOTTOM
- ENDIF
- CASE choice ='P'
- * ---Previous record.
- SKIP -1
- IF BOF()
- GOTO TOP
- ENDIF
- CASE choice ='T'
- * ---Top record.
- GOTO TOP
- CASE choice ='B'
- * ---Bottom record.
- GOTO BOTTOM
- ENDCASE
- ENDDO
- *
- * ---Closing operations.
- SET COLOR TO {WindowColor}
- CLEAR
- SET SCOREBOARD ON
- SET BELL ON
- SET TALK ON
- RETURN
- * EOF: {prgname}
- <<end>> <<*ProgramBody*>>
-
- <<* SIMMAIN.INC *>>