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

  1. ***lister.prg
  2. ***** dbase adviser nov. 1984
  3. ****** p. 59
  4. ****** typed in by don saba
  5. ****** requires a holdfile.dbf
  6. * line,c,80 parameters
  7. * can be used as .cmd or .prg
  8. ERASE
  9. SET talk OFF
  10. SET colon OFF
  11. STORE '        ' TO filename,filetype
  12. @ 5,10 SAY 'ENTER NAME OF FILE TO LIST ' 
  13. @ 5,42 GET filename PICTURE '!!!!!!!!' 
  14. @ 5,50 SAY '.PRG' 
  15. READ
  16. STORE trim (filename) + '.PRG' TO cmdfile
  17. *make sure that the command file exists
  18. IF FILE (cmdfile)
  19.   STORE trim(filename)+ '.PRG' TO oldfile
  20.   STORE trim(filename)+ '.TXT' TO newfile
  21.   RENAME &oldfile TO &newfile
  22.   USE holdfile
  23.   *delete records in holdfile
  24.   COPY TO holdtemp STRUCTURE
  25.   USE holdtemp
  26.   COPY TO holdfile STRUCTURE
  27.   APPEND FROM &newfile sdf
  28.   *should be append from &newfile sdf for line > '
  29.   * for line > 1 
  30.   RENAME &newfile TO &oldfile
  31.   *delete temporary file
  32.   DELETE FILE hold temp
  33.   LIST
  34. ELSE
  35.   ? ".PRG FILE DOES NOT EXIST" 
  36. ENDIF FILE (cmdfile) 
  37. RELEASE ALL
  38. SET talk ON
  39. * scroll.prg this program creates a database file from
  40. * a command file to permit editing
  41. SET talk OFF
  42. COUNT TO numrec
  43. STORE 1 TO linenum
  44. STORE ' ' TO muser
  45. STORE t TO menu
  46. ERASE
  47. DO WHILE menu
  48.   @ 23,1 SAY "A=LIST ALL.  B=BACKWARD LIST.  F=FORWARD LIST.  X=QUIT " ;
  49.   GET muser PICTURE '!' 
  50.   READ
  51.   IF muser = 'X' 
  52.     STORE f TO menu
  53.   ENDIF muser = 'X'  
  54.   DO CASE
  55.     CASE muser = 'A' 
  56.       STORE 1 TO linenum
  57.       ERASE
  58.       GO TOP
  59.       STORE 1 TO mptr
  60.       DO WHILE .not. eof
  61.         STORE line TO dline
  62.         ? #, "   " ,trim(dline)
  63.         *advance to next record
  64.         SKIP
  65.         STORE linenum +1 TO linenum
  66.       ENDDO WHILE .not. eof 
  67.       ?
  68.     CASE muser = 'B' 
  69.       IF linenum<23
  70.         STORE 21 +linenum TO scroll
  71.       ELSE
  72.         IF #=numrec
  73.           STORE 43 TO scroll
  74.         ELSE
  75.           STORE 44 TO scroll
  76.         ENDIF #=numrec 
  77.       ENDIF linenum<23 
  78.       STORE 1 TO linenum
  79.       STORE # TO recnum
  80.       STORE recnum-scroll TO recnum
  81.       IF recnum <1
  82.         STORE 1 TO recnum
  83.       ENDIF recnum <1 
  84.       ERASE
  85.       GOTO RECORD recnum
  86.       DO WHILE linenum <23 .AND. .not. eof
  87.         STORE line TO dline
  88.         ? #, "   " ,trim(dline)
  89.         SKIP
  90.         STORE linenum +1 TO TO linenum
  91.       ENDDO WHILE linenum <23 .AND. .not. eof 
  92.     CASE muser = "F" 
  93.  
  94.  
  95.   
  96.