home *** CD-ROM | disk | FTP | other *** search
- *****************************************************************
- * Test program for MAKENDX, DBNAMES, PICKIT FILE T_MAKEND.PRG
- *****************************************************************
-
- * Copyright(c) 1991 -- James Occhiogrosso
-
- # include "inkey.ch"
-
- LOCAL db_error := '', choices := keypress := 0, index_ok := .F.,;
- text_array := {}, dbf_array := {}
-
- INITGLOBAL()
- SETCOLOR(colstd)
-
- DO WHILE keypress != K_ESC
-
- CLEAR
- * Clear and load arrays with database names/descriptions
- text_array := {} ; dbf_array := {}
-
- * Get database names for indexing
- db_error = DBNAMES('arsystem.def', text_array, dbf_array)
-
- IF EMPTY(db_error)
-
- * Use PICKIT to display the text array and fill
- * return array with operator selections
-
- CENTERON(24, 'Use up/dn arrow keys to move highlight.';
- + ' Press return to select, Esc when done.')
-
- choices = PICKIT(5, 12, 15, 64, text_array, dbf_array)
- @ 24, 0
- index_ok = .F.
- IF choices > 0
-
- * Call MAKENDX with array of selected database names
- * and name of application data dictionary to
- * recreate indexes for selected databases
-
- index_ok = MAKENDX(dbf_array, "arsystem.def")
-
- ENDIF
-
- IF index_ok
- @ 24, 10 SAY 'Indexing complete. '
- ELSE
- @ 24, 10 SAY IF(choices = 0, 'No selections made ', ;
- 'Indexing error. ')
- ENDIF
-
- ELSEIF db_error = 'D'
- @ 24, 10 SAY 'Data dictionary file missing.'
-
- ELSEIF db_error = 'P'
- @ 24, 10 SAY 'Incorrect Parameter passed. '
-
- ELSE
- @ 24, 10 SAY 'Error with file ' + db_error
- ENDIF
-
- ?? ' Press any key to loop, or Esc to quit '
- keypress = INKEY(0)
- @ 24, 0
-
- ENDDO
-
- RETURN
-
-