Vinha pedir uma ajudinha,
Tenho este rotina de programa e quando teclo F10 ele chama o dbedit que tem uma rotina que grava os dados mas, depois se teclar na tecla enter o programa sai desta rotina.
Eu queria saber que quando teclo na tecla enter depois de F10 o programa não entre no get do vunit.
Obrigadão a todos
Um abraço
Código: Selecionar todos
public cvara,varia,sai,novo
priv l,vapaga
priv vprod,vunit,vitem,vvenda,rvtotal
saida=.f.
tit("Vendas (INCLUSÇO)")
rot="INCLUI_ITEM"
sai=0
cor(3)
rvtotal=0
@04,00 say "Venda Data Cliente Total"
cor(4)
*@05,00 say strzero(a1->venda,5,0)
@05,00 say "00000"
@05,06 say dtoc(a1->data)
@05,17 say a1->cliente
*@05,28 say tran(a1->total,'@E 999,999.99')
cor(2)
sele 1
var()
sele 2
set orde to 1
* CRIA ARQ TEMP***************************
copy stru to temp
sele 21
use temp alia b21
appe blan
set filt to recno()>1
inde on descend(item) to temp1
inde on item to temp2
set inde to temp1,temp2
set orde to 2
sele 2
seek strzero(a1->venda,5,0)
*FIM*******************************************
sele 3
use produtos
inde on prod to iprod
inde on codigo to iquant
varia=""
do whil .t.
vquant=0
vunit=0
sai=0
band=.f.
sele 21
publ v1c[1],v2c[1],v3c[1],v4c
v1c[1]="strzero(item,3,0)+' '+tran(quant,'@E 999,999')+' '+substr(prod,1,4)+' '+tran(unit,'@E 9,999.99')+' '+tran(quant*unit,'@E 999,999.99')+str(recno())+iif(deleted(),'sim','nao')"
v3c[1]="Item Quant Produto Unit Total"
v2c[1]="@"
v4c=""
pfs("[F5ExcluiLinha,F10Grava")
cor(2)
keyb chr(26)
set delete on
rot="INCLUI_ITEM"
dbedit(07,00,19,73,v1c,"fc",v2c,v3c,v4c)
sele 21
cur(1)
do whil .T.
sele 3
IF band=.f.
ulti=lastkey()
keyb chr(ulti)
endif
@20,01 get vquant pict "@E 999,999"
read
l=lastkey()
IF l=-1
save screen to tem
rot="ORDENAP"
do mv_p
band=.t.
vunit=0
sele 21
vunit=0
restore scre from tem
loop
ENDIF
IF l=27
exit
ENDIF
IF vquant=0
loop
ENDIF
seek vquant
IF .NOT. found()
band=.t.
loop
else
@ 20,20 say prod
ENDIF
*vquant=asc(ltrim(str(vquant)))
IF l=27
exit
ENDIF
sele 21
exit
endd
IF sai=1
loop
endif
IF VQUANT<>0
do whil .T.
@ 20,52 get vunit pict "@E 999,999"
read
l=lastkey()
IF l=-1
loop
ENDIF
IF l=27
exit
ENDIF
IF vunit=0
exit
ENDIF
IF l=13
exit
ENDIF
endd
ENDIF
IF l=13 .AND. saida=.t.
saida=.f.
exit
ENDIF
IF (l=13 .AND. vunit=0) .OR. (l=13 .AND. sai=1 .AND. vunit=0)
loop
ENDIF
IF l=27
exit
ENDIF
sele 21
set deleted off
set orde to 2
go bott
vitem=item+1
vprod=space(len(prod))
vvenda=venda+1
set orde to 1
rvtotal=rvtotal+(vunit*vquant)
@05,28 say tran(rvtotal,'@E 999,999.99')
SELE 21
go bott
cur(0)
sele 21
appe blan
repl prod with C->prod
repl quant with vquant
repl unit with vunit
repl venda with vvenda
repl item with vitem
repl total with vquant*vunit
dbcommit()
endd
rele v1c,v2c,v3c,v4c
rot="MV"
wait "apagamento ficheiro"
sele 21
use
l=sdd+"\temp.dbf"
erase &l
l=sdd+"\temp1.ntx"
erase &l
sele 1
