home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / dbadv.zip / SCROLL.PRG < prev    next >
Text File  |  1986-02-25  |  2KB  |  68 lines

  1. * scroll.prg this program creates a database file from
  2. * a command file to permit editing
  3. SET talk OFF
  4. COUNT TO numrec
  5. STORE 1 TO linenum
  6. STORE ' ' TO muser
  7. STORE t TO menu
  8. ERASE
  9. DO WHILE menu
  10.   @ 23,1 SAY "A=LIST ALL.  B=BACKWARD LIST.  F=FORWARD LIST.  X=QUIT " ;
  11.   GET muser PICTURE '!' 
  12.   READ
  13.   IF muser = 'X' 
  14.     STORE f TO menu
  15.   ENDIF muser = 'X' 
  16.   DO CASE
  17.     CASE muser = 'A' 
  18.       STORE 1 TO linenum
  19.       ERASE
  20.       GO TOP
  21.       STORE 1 TO mptr
  22.       DO WHILE .not. eof
  23.         STORE line TO dline
  24.         ? #, "   " ,trim(dline)
  25.         *advance to next record
  26.         SKIP
  27.         STORE linenum +1 TO linenum
  28.       ENDDO WHILE .not. eof 
  29.       ?
  30.     CASE muser = 'B' 
  31.       IF linenum<23
  32.         STORE 21 +linenum TO scroll
  33.       ELSE
  34.         IF #=numrec
  35.           STORE 43 TO scroll
  36.         ELSE
  37.           STORE 44 TO scroll
  38.         ENDIF #=numrec 
  39.       ENDIF linenum<23 
  40.       STORE 1 TO linenum
  41.       STORE # TO recnum
  42.       STORE recnum-scroll TO recnum
  43.       IF recnum <1
  44.         STORE 1 TO recnum
  45.       ENDIF recnum <1 
  46.       ERASE
  47.       GOTO RECORD recnum
  48.       DO WHILE linenum <23 .AND. .not. eof
  49.         STORE line TO dline
  50.         ? #, "   " ,trim(dline)
  51.         SKIP
  52.         STORE linenum +1 TO linenum
  53.       ENDDO WHILE linenum <23 .AND. .not. eof 
  54.     CASE muser = "F" 
  55.       ERASE
  56.       STORE 1 TO linenum
  57.       DO WHILE linenum <23 .AND..not.eof
  58.         STORE line TO dline
  59.         ? #, "   " ,trim(dline)
  60.         SKIP
  61.         IF .not.eof
  62.           STORE linenum +1 TO linenum
  63.         ENDIF .not.eof 
  64.       ENDDO WHILE linenum <23 .AND..not.eof 
  65.   ENDCASE 
  66. ENDDO WHILE menu 
  67. SET talk ON
  68.