Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
Loop in GRID when AfterRowColChange
Versions des environnements
Hello comunity
I have a problem on my programs when a use the Event AfterRowColChange
because my code enter in loop and i can´t control them.
my code is the following :
select fo
if sfo.editing or sfo.adding
select fn
if changed("fn.tabiva")
local msel as string, msel2 as string, nextstep as boolean,msel4,lcdim2,lcdim3,lcdim4,newstep as boolean,lcnatur
msel=''
lcnatur = ''
lcdim2=''
lcdim3=''
lcdim4=''
msel=[select cod,conta,decricao,tabiva,txiva,escolha=cast(0 as bit) from u_ivnew (Nolock) where u_ivnew.coddpiva=']+alltrim(fn.usr4)+[']
if not u_sqlexec(msel,[AIV]) then
mensagem( msel, 'directa' )
endif
DECLARE list_tit(6),list_cam(6),list_tam(6),list_pic(6),list_ronly(6)
list_tit(2)="Código"
list_tit(3)="Descrição"
list_tit(4)="Conta"
list_tit(5)="Tabela-IVA"
list_tit(6)="Tx.IVA"
list_tit(1)="Escolha"
list_cam(2)="AIV.cod"
list_cam(3)="AIV.decricao"
list_cam(4)="AIV.Conta"
list_cam(5)="AIV.TABIVA"
list_cam(6)="AIV.txiva"
list_cam(1)="AIV.Escolha"
list_ronly(2)=.t.
list_ronly(3)=.t.
list_ronly(4)=.t.
list_ronly(5)=.t.
list_ronly(6)=.t.
list_ronly(1)=.f.
list_pic(2)=""
list_pic(3)=""
list_pic(4)=""
list_pic(5)=""
list_pic(6)="99"
list_pic(1)="LOGIC"
list_tam(2)=8*40
list_tam(3)=8*40
list_tam(4)=8*40
list_tam(5)=8*40
list_tam(6)=8*40
list_tam(1)=8*40
m.escolheu=.f.
CURSORSETPROP('Buffering',5,'AIV')
browlist('Escolha o Codigo do IVA','AIV','IVA2433',.t.,.t.,.t.)
if m.escolheu = .t. then
messagebox( 'OK' )
endif
if m.escolheu = .f. then
messagebox( 'cancelou' )
endif
&&Contador de linhas de escolha
i = 0
select AIV
scan for escolha = .t.
i = i + 1
Endscan
If i = 1 and m.escolheu = .t. then
select AIV
scan for escolha = .t.
select fn
replace fn.u_coddpiva with AIV.cod
replace fn.tabiva with AIV.tabiva
replace fn.iva with val(AIV.txiva)
do foiliq
select AIV
Endscan
sfo.showsave
Endif
endif
endif
in this code , if i changed the value of my active cell FN.TABIVA i want that my event open a Browlist cursor to choose a field. to this point my event work fine, but when the active cell loose the focus my code loops all the time.
someone have an ideia to control this situation.
Many thanks
Luis Santos
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement