#include "fivewin.ch"
#include "ord.ch"
#include "dtpicker.ch"
REQUEST HB_Lang_IT
REQUEST HB_CODEPAGE_ITWIN
REQUEST DBFCDX
REQUEST DBFFPT
EXTERNAL ORDKEYNO,ORDKEYCOUNT,ORDCREATE,ORDKEYGOTO
FUNCTION Main()
HB_LangSelect("IT")
HB_SetCodePage("ITWIN")
SET _3DLOOK ON
SET CENTURY ON
SET DATE ITALIAN
RDDSetDefault( 'DBFCDX' )
Converte_Orario()
RETURN NIL
// converte Orario.Xls to Dbf
Function Converte_Orario()
Local oRange,lOpened:=.f.
Local cDir:= ".\"
Create_Dbf(cDir)
oRange := GetExcelRange("C:\Work\Errori\xlstodbf\orario.xls" , , @lOpened)
USE tabella ALIAS TA
SELECT TA
FW_ExcelToDBF( oRange, nil, .t. )
xbrowse(oRange)
oRange := NIL
RETURN NIL
//-------------------------------------------------------------------------//
Function Create_Dbf(cDir)
DBCREATE(cDir+'TA',;
{{'teacher','C',024,000},;
{'Mon1','C',004,000},; // Monday
{'Mon2','C',004,000},;
{'Mon3','C',004,000},;
{'Mon4','C',004,000},;
{'Mon5','C',004,000},;
{'Mon6','C',010,000},;
{'Mon7','C',004,000},;
{'Mon8','C',004,000},;
{'Mon9','C',004,000},;
{'Mon10','C',010,000},;
{'Tue1','C',004,000},; // Tuesday
{'Tue2','C',004,000},;
{'Tue3','C',004,000},;
{'Tue4','C',004,000},;
{'Tue5','C',004,000},;
{'Tue6','C',010,000},;
{'Tue7','C',004,000},;
{'Tue8','C',004,000},;
{'Tue9','C',004,000},;
{'Tue10','C',010,000},;
{'Wed1','C',004,000},; //Wednesday
{'Wed2','C',004,000},;
{'Wed3','C',004,000},;
{'Wed4','C',004,000},;
{'Wed5','C',004,000},;
{'Wed6','C',010,000},;
{'Wed7','C',004,000},;
{'Wed8','C',004,000},;
{'Wed9','C',004,000},;
{'Wed10','C',010,000},;
{'Thu1','C',004,000},; //Thursday
{'Thu2','C',004,000},;
{'Thu3','C',004,000},;
{'Thu4','C',004,000},;
{'Thu5','C',004,000},;
{'Thu6','C',010,000},;
{'Thu7','C',004,000},;
{'Thu8','C',004,000},;
{'Thu9','C',004,000},;
{'Thu10','C',010,000},;
{'Fri1','C',004,000},; //Friday
{'Fri2','C',004,000},;
{'Fri3','C',004,000},;
{'Fri4','C',004,000},;
{'Fri5','C',004,000},;
{'Fri6','C',010,000},;
{'Fri7','C',004,000},;
{'Fri8','C',004,000},;
{'Fri9','C',004,000},;
{'Fri10','C',010,000},;
{'Sat1','C',004,000},; //Saturday
{'Sat2','C',004,000},;
{'Sat3','C',004,000},;
{'Sat4','C',004,000},;
{'Sat5','C',004,000},;
{'Sat6','C',010,000},;
{'Sat7','C',004,000},;
{'Sat8','C',004,000},;
{'Sat9','C',004,000},;
{'Sat10','C',010,000}}, 'DBFCDX')
close all
use &(cDir+'TA') new
select TA
if FILE(cDir+'Tabella.DBF')
delete file &(cdir+'Tabella.cdx')
append from &(cdir+'Tabella')
dbcommitall()
close all
delete file &(cdir+'Tabella.dbf')
endif
close all
rename &(cdir+'Ta.dbf') to &(cdir+'Tabella.dbf')
return nil
//---------------------------------------------------------------------------------//