home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
disk_20.zip
/
DB3DOC_2.ZIP
/
DB3DOC.PRG
< prev
Wrap
Text File
|
1986-02-28
|
5KB
|
135 lines
* DB3DOC_2.PRG
* Author : Steve Aidikonis - AIDCOM 312/289-2390
* Created: August, 1985
* Revised by Carl G. Slutter
* Revised February 27, 1986 to incorporate saving of file descriptions for
* future use and to permit documentation of a file containing more than
* 89 fields
* Requires use of Procedure File DOCPROC.PRG
* For dBASE III, this program shows the use of the COPY STRUCTURE EXTENDED
* command.
* This program will help document the data file of your choosing
SET TALK OFF
SET DELIM OFF
set procedure to docproc
CLEAR ALL
CLEAR
* the memvar BIGLOOP is the main loop - Program will keep doing it's
* thing until you tell it to stop or enter an invalid file name
BIGLOOP=.T.
DO WHILE BIGLOOP
CLEAR
@ 2,0 SAY "dBASE III Database Document Maker -- Revision 2"
STORE " A I D C O M 312/289-2390 " TO CMRCL
store " V J Consulting (301)924-4276 " to cmrcl1
@ 4,0 GET CMRCL
@ 6,0 get cmrcl1
CLEAR GETS
RELEASE CMRCL, cmrcl1
@ 10,0
ACCE "Please enter the database name: " TO MFILE
mem_file = mfile
STORE UPPER(MFILE)+".DBF" TO MFILE
* look for the .DBF - if it's not there, exit
IF .NOT. FILE('&MFILE')
CLEAR
@ 10,0 SAY "Data file doesn'T EXIST... EXITING."
CLEAR ALL
SET DELIM ON
RETURN
ENDIF
USE &MFILE
* take a look at the file structure before starting
DISPLAY STRUCTURE
?
? "====================================="
?
ACCEPT "Press <CR> =====> " TO X
CLEAR
MDESCRIP=SPACE(30)
@ 12,33 say "W O R K I N G"
set console off
num_fields = 0
null = ""
do fileno with num_fields, null
tester = 1
do testit with num_fields, tester
set console on
clear
if file('&mem_file'+'.mem')
restore from &mem_file additive
endif
* memvar MDESCRIP allows for a 30 char. general description of the file.
@ 5,0 SAY "File Description, &MFILE : " GET MDESCRIP
READ
* here's the biggie - STRUCTURE EXTENDED creates a database containing
* only the names, length, type and decimal spaces for your file
COPY TO DOCS STRUCTURE EXTENDED
CLEAR
USE DOCS
GO TOP
@ 1,1 SAY "Data File:"
@ 1,13 SAY MFILE
@ 1,33 SAY "File Descrip.:"
@ 1,49 SAY MDESCRIP
@ 2,0 SAY "_______________________________________________________"
@ 2,55 SAY "________________________"
@ 4,0 SAY "Field No. Field Name Type Width Dec."
@ 4,55 SAY "Field Description"
@ 5,0 SAY "========= ========== ==== ===== ===="
@ 5,55 SAY "========================="
STORE 6 TO LINE
STORE 1 TO COUNTER
* go down the list of field names to allow addition of less terse field
* descriptions
cstr = ""
do screeno with counter, cstr
* end of file? Print it!!
CLEAR
ACCEPT "Turn on the printer and press <CR> =======> " TO X
CLEAR
@ 10,0 SAY "Printing the documentation for "+MFILE
GOTO TOP
SET DEVICE TO PRINT
COUNTER=1
HEADING=.T.
cstr=""
do printo with counter, heading, cstr
STORE LINE+1 TO LINE
@ LINE,0 SAY "_______________________________________________________"
@ LINE,55 SAY "________________________"
SET DEVI TO SCREEN
USE
* finished printing, erase the structure file
Clear
store ' 'to yn
@ 5,5 say "Do you wish to save this listing " get yn picture "!"
read
if yn="Y"
release mfile
save to &mem_file
endif
ERASE DOCS.DBF
EJECT
CLEAR
* check to see if there are any more files you wish to document
STORE ' ' TO ANS
DO WHILE AT(ANS,'YN')=0
@ 10,0 SAY "Do you wish to document another Database? ===> " ;
GET ANS PICT '!'
READ
ENDDO
* if not, exit the loop and the program
IF ANS='N'
STORE .F. TO BIGLOOP
close procedure
ENDIF
ENDDO
@ 10,0
@ 10,0 SAY "THAT'S ALL FOLKS!"
SET DELIM ON
RETURN
********* END OF FILE
*******************************************************************