Auxilio - perda de informação na alteração
Enviado: 17 Set 2007 10:30
Bom dia, tem algum problema nessa rotina, tem como fazer o teste se a gravacao na alteracao, prq ta perdendo muita informaçao.
*.prg
select 1
if netuse("carne",.f.,10)
set index to carnum
else
msgar()
return
endif
do while .t.
@2,2 clear to 20,78
select 1
sn=' '
xcarne=0
@02,03 say 'N§ Carne...:' get xcarne pict '9999'
read
if empty(xcarne)
restore screen from tela5
return
endif
seek xcarne
if .not. found()
msgnc()
loop
endif
if rlock()
xcarne=n_carne
xdata=data
xnome=nome
xdatanasc=datanasc
xendereco=endereco
xcidade=cidade
xcarencia=carencia
xuf=uf
xcep=cep
xtel=telefone
xfilho1=filho1
xdatanasc1=datanas1
xfilho2=filho2
xdatanasc2=datanas2
xfilho3=filho3
xdatanasc3=datanas3
xfilho4=filho4
xdatanasc4=datanas4
xfilho5=filho5
xdatanasc5=datanas5
xtaxa=taxa
xano=ano
xjan=janeiro
xfev=fevereiro
xmar=marco
xabr=abril
xmai=maio
xjun=junho
xjul=julho
xago=agosto
xset=setembro
xout=outrubo
xnov=novembro
xdez=dezembro
xjand=jand
xfevd=fevd
xmard=mard
xabrd=abrd
xmaid=maid
xjund=jund
xjuld=juld
xagod=agod
xsetd=setd
xoutd=outd
xnovd=novd
xdezd=dezd
carencia(xcarencia)
@02,60 say xdata
@02,45 say 'Data Entrada:'
@03,03 say 'Nome........:' + xnome
@03,69 say xdatanasc
@03,55 say 'Data Nasc...:'
@04,03 say 'Endereco....:' + xendereco
@05,03 say 'Cidade......:' + xcidade
@05,40 say 'UF....:' + xuf
@05,55 say 'CEP...:' +STR(xcep)
@06,03 say 'Carencia ate:' + dtoc(xcarencia)
@08,2 to 08,78 double
setcolor(cor3)
@08,32 say ' 1§ Quitacao '
setcolor(cor1)
@15,2 to 15,78 double
setcolor(cor3)
@15,32 say ' 2§ Quitacao '
setcolor(cor1)
if xdez='PG'
alert("Aten‡Æo!!!; Nao esqueca de virar o ano.")
endif
if xdez='xx'
@09,03 say 'ANO..:' get xano pict '9999'
xjan=space(2)
xfev=space(2)
xmar=space(2)
xabr=space(2)
xmai=space(2)
xjun=space(2)
xjul=space(2)
xago=space(2)
xset=space(2)
xout=space(2)
xnov=space(2)
xdez=space(2)
xjand=ctod("")
xfevd=ctod("")
xmard=ctod("")
xabrd=ctod("")
xmaid=ctod("")
xjund=ctod("")
xjuld=ctod("")
xagod=ctod("")
xsetd=ctod("")
xoutd=ctod("")
xnovd=ctod("")
xdezd=ctod("")
else
* @09,03 say 'ANO..:' +str(xano)
endif
@09,03 say 'ANO..:' get xano pict '9999'
@09,15 say 'TAXA.:' +str(xtaxa)+' %'
@10,03 say 'JAN:' get xjan pict '@!' valid pago(xjan)
* @10,11 say 'Dat:' get xjand when xjan='PG' valid xjand <> ctod("")
@11,03 say 'FEV:' get xfev pict '@!' valid pago(xfev)
* @11,11 say 'Dat:' get xfevd when xfev='PG' valid xfevd <> ctod("")
@12,03 say 'MAR:' get xmar pict '@!' valid pago(xmar)
* @12,11 say 'Dat:' get xmard when xmar='PG' valid xmard <> ctod("")
@13,03 say 'ABR:' get xabr pict '@!' valid pago(xabr)
* @13,11 say 'Dat:' get xabrd when xabr='PG' valid xabrd <> ctod("")
@10,27 say 'MAI:' get xmai pict '@!' valid pago(xmai)
* @10,35 say 'Dat:' get xmaid when xmai='PG' valid xmaid <> ctod("")
@11,27 say 'JUN:' get xjun pict '@!' valid pago(xjun)
* @11,35 say 'Dat:' get xjund when xjun='PG' valid xjund <> ctod("")
@12,27 say 'JUL:' get xjul pict '@!' valid pago(xjul)
* @12,35 say 'Dat:' get xjuld when xjul='PG' valid xjuld <> ctod("")
@13,27 say 'AGO:' get xago pict '@!' valid pago(xago)
* @13,35 say 'Dat:' get xagod when xago='PG' valid xagod <> ctod("")
@10,51 say 'SET:' get xset pict '@!' valid pago(xset)
* @10,59 say 'Dat:' get xsetd when xset='PG' valid xsetd <> ctod("")
@11,51 say 'OUT:' get xout pict '@!' valid pago(xout)
* @11,59 say 'Dat:' get xoutd when xout='PG' valid xoutd <> ctod("")
@12,51 say 'NOV:' get xnov pict '@!' valid pago(xnov)
* @12,59 say 'Dat:' get xnovd when xnov='PG' valid xnovd <> ctod("")
@13,51 say 'DEZ:' get xdez pict '@!' valid pago(xdez)
* @13,59 say 'Dat:' get xdezd when xdez='PG' valid xdezd <> ctod("")
read
if lastkey()=27
restore screen from tela5
do mancar
endif
@24,20 say ' 1§ Quitacao [S/N] ' get sn pict '!' valid sn $ "SN"
read
if sn="N"
unlock
loop
endif
if sn='S'
tempo1(08,05)
select 1
* replace taxa with xtaxa
replace ano with xano
replace janeiro with xjan
replace jand with xjand
replace fevereiro with xfev
replace fevd with xfevd
replace marco with xmar
replace mard with xmard
replace abril with xabr
replace abrd with xabrd
replace maio with xmai
replace maid with xmaid
replace junho with xjun
replace jund with xjund
replace julho with xjul
replace juld with xjuld
replace agosto with xago
replace agod with xagod
replace setembro with xset
replace setd with xsetd
replace outrubo with xout
replace outd with xoutd
replace novembro with xnov
replace novd with xnovd
replace dezembro with xdez
replace dezd with xdezd
replace funciona with user
replace fdata with date()
DBcommit()
unlock
endif
endif
enddo
Desde ja agradeco sua atenção.
*.prg
select 1
if netuse("carne",.f.,10)
set index to carnum
else
msgar()
return
endif
do while .t.
@2,2 clear to 20,78
select 1
sn=' '
xcarne=0
@02,03 say 'N§ Carne...:' get xcarne pict '9999'
read
if empty(xcarne)
restore screen from tela5
return
endif
seek xcarne
if .not. found()
msgnc()
loop
endif
if rlock()
xcarne=n_carne
xdata=data
xnome=nome
xdatanasc=datanasc
xendereco=endereco
xcidade=cidade
xcarencia=carencia
xuf=uf
xcep=cep
xtel=telefone
xfilho1=filho1
xdatanasc1=datanas1
xfilho2=filho2
xdatanasc2=datanas2
xfilho3=filho3
xdatanasc3=datanas3
xfilho4=filho4
xdatanasc4=datanas4
xfilho5=filho5
xdatanasc5=datanas5
xtaxa=taxa
xano=ano
xjan=janeiro
xfev=fevereiro
xmar=marco
xabr=abril
xmai=maio
xjun=junho
xjul=julho
xago=agosto
xset=setembro
xout=outrubo
xnov=novembro
xdez=dezembro
xjand=jand
xfevd=fevd
xmard=mard
xabrd=abrd
xmaid=maid
xjund=jund
xjuld=juld
xagod=agod
xsetd=setd
xoutd=outd
xnovd=novd
xdezd=dezd
carencia(xcarencia)
@02,60 say xdata
@02,45 say 'Data Entrada:'
@03,03 say 'Nome........:' + xnome
@03,69 say xdatanasc
@03,55 say 'Data Nasc...:'
@04,03 say 'Endereco....:' + xendereco
@05,03 say 'Cidade......:' + xcidade
@05,40 say 'UF....:' + xuf
@05,55 say 'CEP...:' +STR(xcep)
@06,03 say 'Carencia ate:' + dtoc(xcarencia)
@08,2 to 08,78 double
setcolor(cor3)
@08,32 say ' 1§ Quitacao '
setcolor(cor1)
@15,2 to 15,78 double
setcolor(cor3)
@15,32 say ' 2§ Quitacao '
setcolor(cor1)
if xdez='PG'
alert("Aten‡Æo!!!; Nao esqueca de virar o ano.")
endif
if xdez='xx'
@09,03 say 'ANO..:' get xano pict '9999'
xjan=space(2)
xfev=space(2)
xmar=space(2)
xabr=space(2)
xmai=space(2)
xjun=space(2)
xjul=space(2)
xago=space(2)
xset=space(2)
xout=space(2)
xnov=space(2)
xdez=space(2)
xjand=ctod("")
xfevd=ctod("")
xmard=ctod("")
xabrd=ctod("")
xmaid=ctod("")
xjund=ctod("")
xjuld=ctod("")
xagod=ctod("")
xsetd=ctod("")
xoutd=ctod("")
xnovd=ctod("")
xdezd=ctod("")
else
* @09,03 say 'ANO..:' +str(xano)
endif
@09,03 say 'ANO..:' get xano pict '9999'
@09,15 say 'TAXA.:' +str(xtaxa)+' %'
@10,03 say 'JAN:' get xjan pict '@!' valid pago(xjan)
* @10,11 say 'Dat:' get xjand when xjan='PG' valid xjand <> ctod("")
@11,03 say 'FEV:' get xfev pict '@!' valid pago(xfev)
* @11,11 say 'Dat:' get xfevd when xfev='PG' valid xfevd <> ctod("")
@12,03 say 'MAR:' get xmar pict '@!' valid pago(xmar)
* @12,11 say 'Dat:' get xmard when xmar='PG' valid xmard <> ctod("")
@13,03 say 'ABR:' get xabr pict '@!' valid pago(xabr)
* @13,11 say 'Dat:' get xabrd when xabr='PG' valid xabrd <> ctod("")
@10,27 say 'MAI:' get xmai pict '@!' valid pago(xmai)
* @10,35 say 'Dat:' get xmaid when xmai='PG' valid xmaid <> ctod("")
@11,27 say 'JUN:' get xjun pict '@!' valid pago(xjun)
* @11,35 say 'Dat:' get xjund when xjun='PG' valid xjund <> ctod("")
@12,27 say 'JUL:' get xjul pict '@!' valid pago(xjul)
* @12,35 say 'Dat:' get xjuld when xjul='PG' valid xjuld <> ctod("")
@13,27 say 'AGO:' get xago pict '@!' valid pago(xago)
* @13,35 say 'Dat:' get xagod when xago='PG' valid xagod <> ctod("")
@10,51 say 'SET:' get xset pict '@!' valid pago(xset)
* @10,59 say 'Dat:' get xsetd when xset='PG' valid xsetd <> ctod("")
@11,51 say 'OUT:' get xout pict '@!' valid pago(xout)
* @11,59 say 'Dat:' get xoutd when xout='PG' valid xoutd <> ctod("")
@12,51 say 'NOV:' get xnov pict '@!' valid pago(xnov)
* @12,59 say 'Dat:' get xnovd when xnov='PG' valid xnovd <> ctod("")
@13,51 say 'DEZ:' get xdez pict '@!' valid pago(xdez)
* @13,59 say 'Dat:' get xdezd when xdez='PG' valid xdezd <> ctod("")
read
if lastkey()=27
restore screen from tela5
do mancar
endif
@24,20 say ' 1§ Quitacao [S/N] ' get sn pict '!' valid sn $ "SN"
read
if sn="N"
unlock
loop
endif
if sn='S'
tempo1(08,05)
select 1
* replace taxa with xtaxa
replace ano with xano
replace janeiro with xjan
replace jand with xjand
replace fevereiro with xfev
replace fevd with xfevd
replace marco with xmar
replace mard with xmard
replace abril with xabr
replace abrd with xabrd
replace maio with xmai
replace maid with xmaid
replace junho with xjun
replace jund with xjund
replace julho with xjul
replace juld with xjuld
replace agosto with xago
replace agod with xagod
replace setembro with xset
replace setd with xsetd
replace outrubo with xout
replace outd with xoutd
replace novembro with xnov
replace novd with xnovd
replace dezembro with xdez
replace dezd with xdezd
replace funciona with user
replace fdata with date()
DBcommit()
unlock
endif
endif
enddo
Desde ja agradeco sua atenção.