home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / xbase / library / clipper / progr_ba / timentxp.prg < prev   
Text File  |  1992-03-01  |  2KB  |  68 lines

  1. #include "box.ch"             
  2.  
  3. #define BORDCOLOR   'w+/n'
  4. #define NORMCOLOR   'w/n'
  5. #define HIGHCOLOR   'w+/r'
  6. #define BARCHAR     '░'
  7.  
  8. /*----------------------------------MYSAY-----------------------------------*/
  9.  
  10. function mySay(nRow, nCol, sMessage, sColor)
  11.  
  12. * begin
  13.   setPos(nRow, nCol)
  14.   dispOut(sMessage, sColor)
  15. return NIL
  16.  
  17. /*--------------------------------STATUSPACK--------------------------------*/
  18.  
  19. function statusPack(sDbfName, aNtxInfo)
  20.  
  21. local lSuccess := .f., nOldArea := select(), nNtxCount := len(aNtxInfo)
  22. local nRow, sScreen, nI, nOldCursor := setCursor(0)
  23.  
  24. begin sequence
  25.   dbSelectArea(select(sDbfName))
  26.   dbUseArea(,, sDbfName, .f., .f.)
  27.   if ( netErr() )
  28.     break
  29.   endIf
  30.  
  31.   if ( aNtxInfo == NIL )
  32.     aNtxInfo := {}
  33.   endIf
  34.   
  35.   nRow := int(((maxRow() + 1) - (nNtxCount + 3)) / 2)
  36.   sScreen := saveScreen(nRow, 1, nRow + nNtxCount + 2, 78)
  37.   dispBox(nRow, 1, nRow + nNtxCount + 2, 78, B_SINGLE + ' ', BORDCOLOR)
  38.   mySay(nRow + 1, 2, padl('Packing ' + sDbfName + ':', 19) + ' ' + space(50) + '    % ', NORMCOLOR)
  39.   for nI := 1 to nNtxCount
  40.     mySay(nRow + nI + 1, 2, padl('Building ' + aNtxInfo[nI,1] + ':', 19) + ' ' + space(50) + '    % ', NORMCOLOR)
  41.   next nI
  42.   
  43.   mySay(nRow + 1, 2, padl('Packing ' + sDbfName + ':', 19) + ' ' + space(50) + '    % ', HIGHCOLOR)
  44.   statusBar(nRow + 1, 22, BARCHAR, HIGHCOLOR)
  45.   statusNumber(nRow + 1, 73, HIGHCOLOR)
  46.   statusOn(18)
  47.   pack                    
  48.   statusOff()
  49.   mySay(nRow + 1, 2, padl('Packing ' + sDbfName + ':', 19) + ' ' + replicate(BARCHAR, 50) + ' 100% ', NORMCOLOR)
  50.   for nI := 1 to nNtxCount
  51.     dbClearIndex()
  52.     dbGoTop()
  53.     mySay(nRow + nI + 1, 2, padl('Building ' + aNtxInfo[nI,1] + ':', 19) + ' ' + space(50) + '    % ', HIGHCOLOR)
  54.     statusBar(nRow + nI + 1, 22, BARCHAR, HIGHCOLOR)
  55.     statusNumber(nRow + nI + 1, 73, HIGHCOLOR)
  56.     statusOn(18)
  57.     dbCreateIndex(aNtxInfo[nI,1], aNtxInfo[nI,2], &('{|| ' + aNtxInfo[nI,2] + '}'))
  58.     statusOff()
  59.     mySay(nRow + nI + 1, 2, padl('Building ' + aNtxInfo[nI,1] + ':', 19) + ' ' + replicate(BARCHAR, 50) + ' 100% ', NORMCOLOR)
  60.   next nI
  61.   use                 
  62.  
  63.   restScreen(nRow, 1, nRow + nNtxCount + 2, 78, sScreen)
  64. end sequence
  65.   select (nOldArea)
  66.   setCursor(nOldCursor)
  67. return lSuccess
  68.