home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
dbadvan.zip
/
LIST.PRG
< prev
next >
Wrap
Text File
|
1987-02-14
|
2KB
|
96 lines
***lister.prg
***** dbase adviser nov. 1984
****** p. 59
****** typed in by don saba
****** requires a holdfile.dbf
* line,c,80 parameters
* can be used as .cmd or .prg
ERASE
SET talk OFF
SET colon OFF
STORE ' ' TO filename,filetype
@ 5,10 SAY 'ENTER NAME OF FILE TO LIST '
@ 5,42 GET filename PICTURE '!!!!!!!!'
@ 5,50 SAY '.PRG'
READ
STORE trim (filename) + '.PRG' TO cmdfile
*make sure that the command file exists
IF FILE (cmdfile)
STORE trim(filename)+ '.PRG' TO oldfile
STORE trim(filename)+ '.TXT' TO newfile
RENAME &oldfile TO &newfile
USE holdfile
*delete records in holdfile
COPY TO holdtemp STRUCTURE
USE holdtemp
COPY TO holdfile STRUCTURE
APPEND FROM &newfile sdf
*should be append from &newfile sdf for line > '
* for line > 1
RENAME &newfile TO &oldfile
*delete temporary file
DELETE FILE hold temp
LIST
ELSE
? ".PRG FILE DOES NOT EXIST"
ENDIF FILE (cmdfile)
RELEASE ALL
SET talk ON
* scroll.prg this program creates a database file from
* a command file to permit editing
SET talk OFF
COUNT TO numrec
STORE 1 TO linenum
STORE ' ' TO muser
STORE t TO menu
ERASE
DO WHILE menu
@ 23,1 SAY "A=LIST ALL. B=BACKWARD LIST. F=FORWARD LIST. X=QUIT " ;
GET muser PICTURE '!'
READ
IF muser = 'X'
STORE f TO menu
ENDIF muser = 'X'
DO CASE
CASE muser = 'A'
STORE 1 TO linenum
ERASE
GO TOP
STORE 1 TO mptr
DO WHILE .not. eof
STORE line TO dline
? #, " " ,trim(dline)
*advance to next record
SKIP
STORE linenum +1 TO linenum
ENDDO WHILE .not. eof
?
CASE muser = 'B'
IF linenum<23
STORE 21 +linenum TO scroll
ELSE
IF #=numrec
STORE 43 TO scroll
ELSE
STORE 44 TO scroll
ENDIF #=numrec
ENDIF linenum<23
STORE 1 TO linenum
STORE # TO recnum
STORE recnum-scroll TO recnum
IF recnum <1
STORE 1 TO recnum
ENDIF recnum <1
ERASE
GOTO RECORD recnum
DO WHILE linenum <23 .AND. .not. eof
STORE line TO dline
? #, " " ,trim(dline)
SKIP
STORE linenum +1 TO TO linenum
ENDDO WHILE linenum <23 .AND. .not. eof
CASE muser = "F"