i'm tryng develop a program where the number of checkbox is variable
i got it make appear on the monitor
but, on the moment of allocation, It does'nt allocate on the variable due
my code:
- Code: Select all Expand view
function filtraPedido()
local oDlg4, x:=1,ou:="" //pra por os 'or' no filtro
local oTipoProd:={}, ;
arrayTProd:={}, ;
consulta:=""
local bConfirma,bCancela
TPROD->(dbgotop())
do while TPROD->(!eof())
aadd(arrayTProd,TPROD->TProd)
aadd(oTipoProd,.t.)
TPROD->(dbskip())
x++
enddo
aadd(arrayTProd,TPROD->TProd)
aadd(oTipoProd,.f.)
x++
define dialog oDlg4 from 2,58 to 2.8*x+3.2,128 //18,73 to 31,118
x:=1
oDlg4:SetFont(oFntDlg)
@ 0.2,2 say "Tipo do Produto:"
do while(x<len(arrayTProd))
@ 1.5*x,1.5 checkbox oTipoProd prompt arrayTProd[x] of oDlg4// ;
x++
enddo
@ 1.14*x,2 button bConfirma prompt "&Confirmar" size 39,9 action( oDlg4:end(1)) of oDlg4
@ 1.14*x,12 button bCancela prompt "C&ancelar" size 39,9 action(oDlg4:end()) of oDlg4
activate dialog oDlg4
if oDlg4:nResult=1
x:=1
select PED
do while(x<len(arrayTProd))
if(oTipoProd[x])
consulta:=consulta+ou+"(alltrim(PED->TipoProd) == '"+alltrim(arrayTProd[x])+"')"
ou:=" .or. "
endif
x++
enddo
msginfo(consulta)
set filter to &consulta
else
PED->(dbclearfilter())
endif
return NIL
thanks a lot for the atetion