Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : DBFXREF.ZIP
Filename : DBFXREF.PRG

 
Output of file : DBFXREF.PRG contained in archive : DBFXREF.ZIP
* FILE NAME: DBFXREF.PRG
* BY: Gary Blatt
* DATE: November 22, 1988
* USAGE: PUT DBFXREF.EXE IN THE SUBDIRECTORY WHERE ALL YOUR *.PRG FILES
* ARE. IF YOU ONLY WANT TO ANALYZE A SELECT FEW, MOVE THEM TO A
* TEMPORARY SUBDIRECTORY WITH DBFXREF.EXE. THE DBF FILES & THE ONE
* INDEX FILE ARE NOT REQUIRED! IF THEY ARE NOT PRESENT IN THE CURRENT
* PATH, THIS PROGRAM WILL CREATE THEM. TO RUN TYPE:DBFXREF
* AS EACH PROGRAM IS PROCESSED, IT WILL DISPLAY THE NAME OF THE PROGRAM
* ON THE SCREEN.
*
* DESC: 1ST CHECKS FOR EXISTENCE OF THE TWO(2) DBF FILES
* NEXT IT READS THE CURRENT DIRECTORY OF *.PRG FILES
* INTO PRG.TXT. THEN IT APPENDS SDF INTO PRGS.
* EACH PROGRAM FILE IS ANALYZED THEN OUTPUT TO DBFXREF
* THEN THE RECORDS IN DBFXREF ARE SORTED BY DATABASE NAME
* AND PRINTED OUT.
* DATA FILES:DBFXREF.DBF, PRGS.DBF, DBFXREF.NDX
clear
clear all
set talk off
if file("DBFXREF.DBF")
use DBFXREF
zap
else
@10,10 say "creating file DBFXREF.DBF"
create dbf_stru
use dbf_stru
append blank
replace field_name with "PNAME",field_type with "C",field_len with 8
append blank
replace field_name with "DNAME",field_type with "C",field_len with 8
append blank
replace field_name with "LNUM",field_type with "N",field_len with 3
replace field_dec with 0
close databases
create dbfxref from dbf_stru
erase dbf_stru.dbf
@10,0 clear
endif
run dir *.PRG>PRG.TXT
select 1
if file("PRGS.DBF")
use PRGS
zap
else
@10,10 say "creating file PRGS.DBF"
create prg_stru
use prg_stru
append blank
replace field_name with "NAME",field_type with "C",field_len with 8
close databases
create prgs from prg_stru
erase prg_stru.dbf
@10,0 clear
use PRGS
endif
append from PRG.TXT SDF
delete for NAME=" "
pack
go top
@10,10 say "PROCESSING - "
do while .not. eof()
FNAME = trim(NAME)+".prg"
FNAME2=NAME
HANDLE = fopen("&FNAME")
if ferror() <> 0
? "File open error on "+FNAME
wait
return
endif
@10,30 say NAME
FLEN = fseek(HANDLE,0,2)
fseek(HANDLE,0)
BUFFER = freadstr(HANDLE,FLEN )
READMORE = .t.
first=.t.
do while READMORE
ULOC = at("use",BUFFER)
if ULOC > 0
COUNTER = 0
if first
LINENO=1
endif
do while COUNTER <= ULOC
LSTR = substr(BUFFER,COUNTER,1)
if asc(LSTR)=13
LINENO=LINENO+1
endif
COUNTER=COUNTER+1
enddo
first=.f.
USTR = substr(BUFFER,ULOC,12)
counter2=1
do while counter2<=12
ustr2=substr(ustr,counter2,1)
if asc(ustr2)<45
exit
endif
counter2=counter2+1
enddo
counter3=1
do while counter3<=12
ustr3=substr(ustr,counter3,1)
if asc(ustr3)<32
ustr=substr(ustr,1,counter3-1)
exit
endif
counter3=counter3+1
enddo
if substr(USTR,7,1)<>" " .and. substr(USTR,5,1)<>" "
select 2
use DBFXREF
append blank
replace PNAME with FNAME2,DNAME with substr(USTR,5,8)
replace LNUM with LINENO
select 1
endif
BUFFER = substr(BUFFER,ULOC+counter2-1)
else
READMORE = .f.
endif
enddo
fclose(HANDLE)
skip
enddo
clear all
set printer on
? space(5)+"DATABASE CROSS-REFERENCE TO PROGRAMS"
? replicate("-",78)
if file("DBFXREF.NDX")
use DBFXREF index DBFXREF
reindex
else
use DBFXREF
index on DNAME to DBFXREF
endif
go top
do while .not. eof()
?
FIRST=DNAME
? space(5)+"Database name: "+chr(27)+chr(69)+DNAME+chr(27)+chr(70)
? space(5)+"Procedure Line #"
do while DNAME=FIRST
? space(6)+PNAME+space(4)+str(lnum,5)
skip
enddo
enddo
set printer off
eject
return

*Formatted by: dANALYST Ver. 7.3y on November 22, 1988 at 3:31 PM.


  3 Responses to “Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : DBFXREF.ZIP
Filename : DBFXREF.PRG

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/