* FLDVARS.RPT
* Paul Ferrara [70075,252]
* Bill Lonborg [70045,1237]
* Last Change: 02-17-86 00:05
*
IF FILE("PARAM.MEM")
   RESTORE FROM param ADDITIVE
ELSE
   STORE CHR(14) TO mprintwide
   STORE 80 TO mpagewdth
   STORE 66 TO mpagelen
ENDIF
SET COLOR TO &mtitl./&mnorb.,&menhf./&menhb.,&mbord
CLEAR
@  1, 0 SAY "PRINT THE DICTIONARY"
@  1,72 SAY date()
@  2, 0 SAY "ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ"
@  2,55 SAY "ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ"
@ 23, 0 SAY "ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ"
@ 23,55 SAY "ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ"
* prepare printer
SET COLOR TO &mblnk.*/&mnorb.,&menhf./&menhb.,&mbord
@  4,32 SAY "Prepare printer."
SET COLOR TO &mmess./&mnorb.,&menhf./&menhb.,&mbord
@  5,19 SAY 'Press "Q" to quit or any key to continue.'
SET COLOR TO &mnorf./&mnorb.,&menhf./&menhb.,&mbord
SET CONSOLE OFF
WAIT TO option
SET CONSOLE ON
IF UPPER(option)="Q"
   CLEAR
   RETURN
ENDIF
@  4, 0
@  5, 0
* test for existence of dictnary file
IF .NOT. FILE("DICTNARY.DBF")
   SET COLOR TO &mblnk.*/&mnorb.,&menhf./&menhb.,&mbord
   @ 20,28 SAY "Dictionary file missing."
   SET COLOR TO &mmess./&mnorb.,&menhf./&menhb.,&mbord
   @ 21,24 SAY "Press any key to return to menu."
   SET COLOR TO &mnorf./&mnorb.,&menhf./&menhb.,&mbord
   SET CONSOLE OFF
   WAIT
   SET CONSOLE ON
   CLEAR
   RETURN
ENDIF
SET COLOR TO &mblnk.*/&mnorb.,&menhf./&menhb.,&mbord
@  4,34 SAY "Please wait."
SELECT 1
USE dictnary
INDEX ON field_name TO temp
SET COLOR TO &mblnk.*/&mnorb.,&menhf./&menhb.,&mbord
@  4, 0
@  4,32 SAY "Printing report."
SET COLOR TO &mnorf./&mnorb.,&menhf./&menhb.,&mbord
SET MARGIN TO INT(mpagewdth-69)/2
SET DEVICE TO PRINT
GO TOP
STORE 1 TO mpage
STORE mpagelen-5 TO mrow
DO WHILE .NOT. EOF()
   IF field_type="X"
      SKIP
      LOOP
   ENDIF
   IF mrow>(mpagelen-6)
      @  1, 0 SAY date()
      @  2, 0 SAY "Page"+STR(mpage,2)
      @  3,13 SAY "Cross Reference of Database Field Variables"
      @  5, 0 SAY " FIELDVAR  WHERE USED"
      @  6, 0 SAY "========== =========================================================="
      *            0          11        21        31
      STORE mpage+1 TO mpage
      STORE 7 TO mrow
   ENDIF
   @ mrow, 0 SAY field_name
   STORE field_name TO mfieldname
   DO WHILE field_name=mfieldname .AND. .NOT. EOF()
      STORE 11 TO mcol
      DO WHILE field_name=mfieldname .AND. mcol<70 .AND. .NOT. EOF()
         @ mrow,mcol SAY LOWER(file_name)
         STORE mcol+10 TO mcol
         SKIP
      ENDDO
      STORE mrow+1 TO mrow
   ENDDO
ENDDO
SET DEVICE TO SCREEN
SET MARGIN TO 0
EJECT
CLOSE DATABASES
ERASE temp.ndx
CLEAR
RETURN
