home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / techs.zip / TECH1.ARC / INSCRN2.PRG next >
Text File  |  1985-11-01  |  2KB  |  71 lines

  1. * Program..: Inscrn2.PRG
  2. * Author...: Christopher White
  3. * Date.....: April 1, 1985
  4. * Version..: dBASE III, any version
  5. * Note(s)..: This program allows multiple input screens using
  6. *            format files for each new record entered into a
  7. *            database and movement between input screens.
  8. *            It is applicable to all versions of dBASE III.
  9. *
  10. *            Be sure that the memory variable last reflects
  11. *            the number of screens that you have defined and
  12. *            that the names of your database and index files are
  13. *            in the USE command.
  14. * ---Set up.
  15. SET TALK OFF
  16. lastpage = 3
  17. more = .T.
  18. USE Yourfile INDEX Yourfile
  19. * ---Add records to database until more is false.
  20. DO WHILE more
  21.    pagecount = 1
  22.    next = .F.
  23.    APPEND BLANK
  24.    * ---Add to the current record until next is true.
  25.    DO WHILE .NOT. next
  26.       *---Convert pagecount to Format screen subscript.
  27.       sub = STR( pagecount,1 )
  28.       * ---Get current screen.
  29.       SET FORMAT TO Screen&sub
  30.       READ
  31.       CLOSE FORMAT
  32.       * ---Display prompt line and get what to do next.
  33.       * ---The default is to go to the next screen.
  34.       choice = " "
  35.       DO WHILE .NOT. choice $ "+-FLNE"
  36.          choice = "+"
  37.          @ 22,3 SAY "+)next page -)prev page F)irst page L)ast page " +;
  38.                     "N)ext record E)xit to menu " GET choice PICTURE "!"
  39.          READ
  40.       ENDDO choice
  41.       * ---Do something.
  42.       DO CASE
  43.       CASE choice = "+"
  44.          * ---Go to next screen.
  45.          IF pagecount <> lastpage
  46.             pagecount = pagecount + 1
  47.          ENDIF
  48.       CASE choice = "-"
  49.          * ---Go to previous screen.
  50.          IF pagecount <> 1
  51.             pagecount = pagecount - 1
  52.          ENDIF
  53.       CASE choice = "F"
  54.          * ---Go to first screen.
  55.          pagecount = 1
  56.       CASE choice = "L"
  57.          * ---Go to lastpage screen.
  58.          pagecount = lastpage
  59.       CASE choice = "N"
  60.          * ---Go to next record.
  61.          next = .T.
  62.       CASE choice = "E"
  63.          * ---Exit from this routine.
  64.          more = .F.
  65.          next = .T.
  66.       ENDCASE
  67.    ENDDO next
  68. ENDDO more
  69. CLOSE DATABASE
  70. RETURN
  71. * EOP Inscrn2.PRG