home *** CD-ROM | disk | FTP | other *** search
/ Software Du Jour / SoftwareDuJour.iso / BUSINESS / DBASE / VIEWGEN.ARC / SAMPLE.PRG < prev    next >
Encoding:
Text File  |  1985-11-05  |  2.3 KB  |  96 lines

  1. * Program.: SAMPLE.PRG
  2. * Author..: Your Name
  3. * Date....: 11/05/85
  4. * Notice..: Copyright 1985, Your Company, All Rights Reserved
  5. * Version.: dBASE III, version 1.1
  6. * Notes...: MAIN program for NAMES.DBF
  7. *
  8. * ---SET environment.
  9. SET TALK OFF
  10. SET BELL OFF
  11. SET MENU OFF
  12. SET SAFETY OFF
  13. SET ESCAPE OFF
  14. SET SCOREBOARD OFF
  15. * ---Open PROCEDURE file.
  16. SET PROCEDURE TO SAM_PROC
  17. * ---SET COLOR TO values.
  18. StatusAtr = "B/,/W"
  19. WindowAtr = "R+/,/W"
  20. PromptAtr = "GR/,/W"
  21. * ---Initialize global variables.
  22. PromptRow = 21
  23. STORE 0 TO key,LastRec
  24. STORE 1 TO oldrecnum,pageno
  25. STORE " " TO choice,expr
  26. PromptBar = "────────────────────────────────────────" +;
  27.             "────────────────────────────────────────"
  28. PgDn = "N"
  29. Returnkey = " "
  30. DelRecord = "D"
  31. CtrlEnd = " "
  32. * ---Open files.
  33. DO OpenFile
  34. * ---Execute main loop.
  35. DO WHILE .T.
  36.    * ---Display main menu and get choice.
  37.    DO SAM_MENU WITH choice
  38.    DO CASE
  39.    CASE choice $ "Q"+Returnkey
  40.       EXIT
  41.    CASE .NOT. choice $ "AH" .AND. LastRec = 0
  42.    @ 17, 0 SAY "EMPTY DATABASE FILE:  Only Append and Help are available."
  43.       WAIT
  44.    CASE choice = "A"
  45.       * ---DO APPEND.
  46.       @ 17, 0 CLEAR
  47.       @ 17, 0 SAY "Preparing to add records..."
  48.       DO SAM_APPE WITH PromptRow
  49.    CASE choice = "B"
  50.       * ---BROWSE the database file.
  51.       SET SCOREBOARD ON
  52.       SET MENU ON
  53.       BROWSE
  54.       SET MENU OFF
  55.       SET SCOREBOARD OFF
  56.    CASE choice = "E"
  57.       * ---DO EDIT/VIEW.
  58.       DO SAM_EDIT WITH PromptRow
  59.    CASE choice = "H"
  60.       * ---DO HELP.
  61.       DO SAM_HELP
  62.    CASE choice = "L"
  63.       * ---DO LABELS.
  64.       DO SAM_LABE
  65.    CASE choice = "P"
  66.       * ---DO PACK.
  67.       @ 17, 0 SAY "PACK the entire file? (y/n)"
  68.       DO GetKey WITH choice,"YN"+Returnkey
  69.       @ 17,0 CLEAR
  70.       IF choice = "Y"
  71.          @ 17, 0 SAY "PACKing the file..."
  72.          DO SAM_PACK WITH 17,"NAMES.$$$","NAMES.DBF","NAMES",;
  73.             "Lastname + Firstname"
  74.          DO OpenFile
  75.          IF LastRec < oldrecnum
  76.             oldrecnum = LastRec
  77.          ENDIF
  78.       ENDIF
  79.    CASE choice = "R"
  80.       * ---DO REPORT.
  81.       DO SAM_REPO
  82.    ENDCASE
  83. ENDDO
  84. * ---Closing operations.
  85. CLEAR
  86. CLOSE DATABASE
  87. CLOSE PROCEDURE 
  88. SET SCOREBOARD ON
  89. SET ESCAPE ON
  90. SET SAFETY ON
  91. SET MENU ON
  92. SET BELL ON
  93. SET TALK ON
  94. RETURN
  95. * EOF: SAMPLE.PRG
  96.