- Code: Select all Expand view
#include "fivewin.ch"
#include "xbrowse.ch"
#include "constant.ch"
REQUEST DBFCDX
REQUEST DBFFPT
Function test()
Local alistini:={}
Local oDlg
Local aGet:= array(1)
Local nIdListino:= 1
Create_Testfile()
USE LISTINI ALIAS LI
LI->(dbgotop())
DO While !LI->(eof())
AaDd(alistini,{ alltrim(LI->GUEST) })
LI->(dbskip())
ENDDO
DEFINE DIALOG oDlg SIZE 200,200;
PIXEL TRUEPIXEL RESIZABLE ;
TITLE " Listino"
@ 12,05 SAY "Listino :" SIZE 80,14 PIXEL OF oDlg
@ 10,55 COMBOBOX aGet[1] VAR nIdListino ITEMS alistini SIZE 120,94 PIXEL OF oDlg STYLE CBS_DROPDOWN
ACTIVATE DIALOG oDlg CENTERED
RETURN NIL
function Create_Testfile()
local aFields := { { "CHECK_IN", "C", 10, 0 },;
{ "CHECK_OUT", "C", 10, 0 },;
{ "GUEST", "C", 10, 0 },;
{ "PRICE_LIST", "C", 10, 0 } }
REQUEST DBFCDX
DbCreate( "LISTINI.dbf", aFields, "DBFCDX" )
USE LISTINI.dbf NEW VIA "DBFCDX"
// generate periods for pricelist 1
appe blank
field->check_in:="17/05/2018"
field->check_out:="27/06/2018"
field->guest="BASSA"
field->price_list="PL1"
appe blank
field->check_in:="30/08/2018"
field->check_out:="20/09/2018"
field->guest="BASSA"
field->price_list="PL1"
appe blank
field->check_in:="28/06/2018"
field->check_out:="25/07/2018"
field->guest="MEDIA"
field->price_list="PL1"
appe blank
field->check_in:="26/07/2018"
field->check_out:="29/08/2018"
field->guest="ALTA"
field->price_list="PL1"
// generate periods for pricelist 2
appe blank
field->check_in:="01/05/2018"
field->check_out:="31/05/2018"
field->guest="BASSA"
field->price_list="PL2"
appe blank
field->check_in:="01/06/2018"
field->check_out:="30/06/2018"
field->guest="ALTA"
field->price_list="PL2"
appe blank
field->check_in:="15/08/2018"
field->check_out:="29/09/2018"
field->guest="BASSA"
field->price_list="PL2"
appe blank
field->check_in:="01/07/2018"
field->check_out:="31/07/2018"
field->guest="MEDIA"
field->price_list="PL2"
appe blank
field->check_in:="01/08/2018"
field->check_out:="14/08/2018"
field->guest="ALTA"
field->price_list="PL2"
close data
return nil
why ?