#include "FiveWin.Ch"
#include "Directry.ch"
#define CLR_LGREEN nRGB( 190, 215, 190 )
#define CLR_LGRAY nRGB( 230, 230, 230 )
#define CLR_VERMELHO nRGB( 255, 000, 000 )
#define CLR_AMARELO nRGB( 255, 255, 000 )
STATIC nBytes, nDisks
STATIC lnKeyEscape := .F.
FUNCTION Backup() // Procedimentos do Backup
LOCAL oSetupDlg, nDriveTo := 1, cDriveTo, nDriveCap := 4
LOCAL lGoOn, aFiles[1], aFileList, x, iDcor, oFont, oBackup
LOCAL oDlg, oBrw, n := 1
LOCAL oAceitar, oCancelar, nKey := VK_RETURN
//LOCAL aDbfs := Directory( "*.DBF" )
LOCAL aDbfs := DirectoryRecurse( "C:\FWH1701\*.*" )
IF Len( aDbfs ) < 1
RETURN Nil
ENDIF
aSort( aDbfs, , , { |x, y | x[1] < y[1] } )
DEFINE FONT oFont NAME "Arial" SIZE 0, 16 BOLD
// 6, 20 TO 25, 78
DEFINE DIALOG oDlg FROM 6, 20 TO 25, 90 ;
TITLE "Browse dos Arquivos DBFs em: " + ;
CurDir() + " Para Copiar" ;
STYLE nOR( WS_BORDER, WS_THICKFRAME ) ;
COLORS CLR_BLACK, nRGB( 193, 205, 205 )
@ 1, 2 ListBox oBrw Fields aDbfs[n][1], ;
Str( aDbfs[n][2], 10, 0 ), ;
Dtoc( aDbfs[n][3] ), ;
aDbfs[n][4] ;
Headers "Nome do Arquivo", ;
"Tamanho", "Data", "Hora" ;
FieldSizes 270, 80, 80, 60 ;
COLOR CLR_HBLUE, CLR_AMARELO ;
FONT oFont ;
Of oDlg Size 260, 100
oBrw:bGotop := { || N := 1 }
oBrw:bGoBottom := { || N := Eval( oBrw:bLogicLen ) }
oBrw:bSkip := { | nWant, nOld | nOld := N , N += nWant, ;
N := Max( 1, Min( N, Eval( oBrw:bLogicLen ) ) ), ;
N - nOld }
oBrw:bLogicLen := { || Len( aDbfs ) }
oBrw:cAlias := "Array"
oBrw:nClrBackHead := CLR_LGREEN
oBrw:nClrBackFocus := CLR_HRED
oBrw:nClrForeFocus := CLR_AMARELO
oBrw:nClrForeHead := CLR_HRED
oBrw:nColAct := 1
oBrw:nLineStyle := 3
oBrw:lCellStyle := .T.
oBrw:aJustify := { .F. , .F. , .F. , .F. }
oBrw:lMChange := .F.
oBrw:SetFocus()
oBrw:Refresh()
@ 6.6, 16 Button oBackup ;
PROMPT "&Test" Of oDlg ;
Action( oDlg:End() ) ;
SIZE 40, 12 ;
CANCEL
ACTIVATE DIALOG oDlg CENTERED
oFont:End()
RETURN NIL