Continuou o problema

Fórum sobre a linguagem CA-Clipper.

Moderador: Moderadores

JuniorVaz
Usuário Nível 3
Usuário Nível 3
Mensagens: 100
Registrado em: 16 Jul 2004 15:49

Continuou o problema

Mensagem por JuniorVaz »

:( Continuou o problema, o arquivo dbf usado nesse caso é o lanord.dbf, e tem sim o campo lote nele, vou colocar abaixo o codigo dessa parte pra ver se alguem da alguma ideia... VLW ae pela ajuda até agora... :)

PS: Este erro está dando na hora em que eu dou s(sim), quando ele vai executar a impressão para o arquivo *.txt

clear
cbc()
setcolor(cor2)
Set date format to "dd/mm/yyyy"
cx(2,2,22,77," GERAR ETIQUETAS POR LOTE ")
setcolor(cor2)
SELE 0
USE LANORD ALIAS ORD
SET INDE TO LANPD,LANTL,LANORD
SELE 0
use cadgra inde cadgra alias gra
set inde to cadgra
SELE 0
use cadMAT inde cadMAT alias MAT
set inde to cadMAT
sele 0
use lanped inde lanped alias ped
set inde to lanped
sele 0
LI=00
xx=savescreen(00,00,24,79)
xdata = date()
do while .t.
SETCOLOR(COR2)
RESTscreen(00,00,24,79,XX)
stor SPACE(03) to xlote
STOR 1 TO TLINI
stor 0 to XNUMPED
STOR 999 TO TLFIM
STOR 999999 TO xnumfim
do while .t.
@ 10,4 say "Lote..: " get xlote pict "!!!"
read
if lastkey()=27 .or. empty(xlote)
exit
endif
@ 12,04 SAY "Digite o Numero do Pedido ou Tecle <ENTER> para todos..: " get XNUMPED pict '999999'
read
if lastkey()=27
loop
endif
if empty(XNUMPED) .or. XNUMPED=0
@ 12,3 clea to 12,70
@ 12,4 SAY "Talao de Inicio..: " get tlini pict "999"
@ 13,4 say "Talao de Fim.....: " get tlfim pict "999" valid tlfim>=tlini
read
ENDIF
cc=' '
@ 15,4 say "Confirma Gera‡Æo de Etiquetas?" get cc pict "!" valid cc $ "SN"
read
if cc="S"
SET Printer To (xlote) + ".txt"
Set Devi to printer
if empty(XNUMPED) .or. XNUMPED=0
sele ord
SET INDE TO LANord
set filter to lote+str(numord,3)>=xlote+str(tlini,3) .and. lote+str(numord,3)<=xlote+str(tlfim,3)
else
SELE ORD
SET INDE TO LANPD
SET FILTER TO LOTE+STR(NUMPED,6)=XLOTE+STR(XNUMPED,6)
endif
do imp_eti
SET DEVI TO SCREEN
exit
else
exit
endif
enddo
enddo
close all
return
*******************

proc imp_eti
SELE ORD
@ li,00 say "Ref#Material#Cor#Numeracao#CodBarra#Figura#Quat#Obs"
SEEK XLOTE+STR(XNUMPED,6)
IF XNUMPED=0 .OR. EMPTY(XNUMPED)
SEEK XLOTE+STR(TLINI,3)
ENDIF
do while .t.
li=00
sele ord
xlote=lote
xgrade = ord->grade
xcodmat = codmat
sele mat
seek xcodmat
xdescmat=descmat
if !empty(gra->t01) .AND. ORD->T01>=1
for i = 1 to ord->t01
li=li+1
@ li,00 say ord->codref+"#"+padr(xdescmat,15,' ')+"#"+ord->cor+"#"+gra->t01+"##"+ord->codref+"#"+"1"+"#"+padr(lote,1,3,' ')+"-"+str(ORD->numord,3)
next
ELSE
endif
if !empty(gra->t02) .AND. ORD->T02>=1
for i = 1 to ord->t02
li=li+1
@ li,00 say ord->codref+"#"+padr(xdescmat,15,' ')+"#"+ord->cor+"#"+gra->t02+"##"+ord->codref+"#"+"1"+"#"+padr(lote,1,3,' ')+"-"+str(ORD->numord,3)
next
ELSE
endif
if !empty(gra->t03) .AND. ORD->T03>=1
for i = 1 to ord->t03
li=li+1
@ li,00 say ord->codref+"#"+alltrim(subs(xdescmat,1,15))+"#"+ord->cor+"#"+gra->t03+"##"+ord->codref+"#"+"1"+"#"+ALLTRIM(SUBS(ord->lote,1,3))+"-"+alltrim(str(ORD->numord,3))
next
ELSE
endif
if !empty(gra->t04) .AND. ORD->T04>=1
for i = 1 to ord->t04
li=li+1
@ li,00 say ord->codref+"#"+alltrim(subs(xdescmat,1,15))+"#"+ord->cor+"#"+gra->t04+"##"+ord->codref+"#"+"1"+"#"+ALLTRIM(SUBS(ord->lote,1,3))+"-"+alltrim(str(ORD->numord,3))
next
ELSE
endif
if !empty(gra->t05) .AND. ORD->T05>=1
for i = 1 to ord->t05
li=li+1
@ li,00 say ord->codref+"#"+alltrim(subs(xdescmat,1,15))+"#"+ord->cor+"#"+gra->t05+"##"+ord->codref+"#"+"1"+"#"+ALLTRIM(SUBS(ord->lote,1,3))+"-"+alltrim(str(ORD->numord,3))
next
ELSE
endif
if !empty(gra->t06) .AND. ORD->T06>=1
for i = 1 to ord->t06
li=li+1
@ li,00 say ord->codref+"#"+alltrim(subs(xdescmat,1,15))+"#"+ord->cor+"#"+gra->t06+"##"+ord->codref+"#"+"1"+"#"+ALLTRIM(SUBS(ord->lote,1,3))+"-"+alltrim(str(ORD->numord,3))
next
ELSE
endif
if !empty(gra->t07) .AND. ORD->T07>=1
for i = 1 to ord->t07
li=li+1

@ li,00 say ord->codref+"#"+alltrim(subs(xdescmat,1,15))+"#"+ord->cor+"#"+gra->t07+"##"+ord->codref+"#"+"1"+"#"+ALLTRIM(SUBS(ord->lote,1,3))+"-"+alltrim(str(ORD->numord,3))
next
ELSE
endif
if !empty(gra->t08) .AND. ORD->T08>=1
for i = 1 to ord->t08
li=li+1
@ li,00 say ord->codref+"#"+alltrim(subs(xdescmat,1,15))+"#"+ord->cor+"#"+gra->t08+"##"+ord->codref+"#"+"1"+"#"+ALLTRIM(SUBS(ord->lote,1,3))+"-"+alltrim(str(ORD->numord,3))
next
ELSE
endif
if !empty(gra->t09) .AND. ORD->T09>=1
for i = 1 to ord->t09
li=li+1
@ li,00 say ord->codref+"#"+alltrim(subs(xdescmat,1,15))+"#"+ord->cor+"#"+gra->t09+"##"+ord->codref+"#"+"1"+"#"+ALLTRIM(SUBS(ord->lote,1,3))+"-"+alltrim(str(ORD->numord,3))
next
ELSE
endif
if !empty(gra->t10) .AND. ORD->T10>=1
for i = 1 to ord->t10
li=li+1
@ li,00 say ord->codref+"#"+alltrim(subs(xdescmat,1,15))+"#"+ord->cor+"#"+gra->t10+"##"+ord->codref+"#"+"1"+"#"+ALLTRIM(SUBS(ord->lote,1,3))+"-"+alltrim(str(ORD->numord,3))
next
ELSE
endif
if !empty(gra->t11) .AND. ORD->T11>=1
for i = 1 to ord->t12
li=li+1
@ li,00 say ord->codref+"#"+alltrim(subs(xdescmat,1,15))+"#"+ord->cor+"#"+gra->t11+"##"+ord->codref+"#"+"1"+"#"+ALLTRIM(SUBS(ord->lote,1,3))+"-"+alltrim(str(ORD->numord,3))
next
ELSE
endif
if !empty(gra->t12) .AND. ORD->T12>=1
for i = 1 to ord->t12
li=li+1
@ li,00 say ord->codref+"#"+alltrim(subs(xdescmat,1,15))+"#"+ord->cor+"#"+gra->t12+"##"+ord->codref+"#"+"1"+"#"+ALLTRIM(SUBS(ord->lote,1,3))+"-"+alltrim(str(ORD->numord,3))
next
ELSE
endif
if !empty(gra->t13) .AND. ORD->T13>=1
for i = 1 to ord->t13
li=li+1
@ li,00 say ord->codref+"#"+alltrim(subs(xdescmat,1,15))+"#"+ord->cor+"#"+gra->t13+"##"+ord->codref+"#"+"1"+"#"+ALLTRIM(SUBS(ord->lote,1,3))+"-"+alltrim(str(ORD->numord,3))
next
ELSE
endif
if !empty(gra->t14) .AND. ORD->T14>=1
for i = 1 to ord->t14
li=li+1
@ li,00 say ord->codref+"#"+alltrim(subs(xdescmat,1,15))+"#"+ord->cor+"#"+gra->t14+"##"+ord->codref+"#"+"1"+"#"+ALLTRIM(SUBS(ord->lote,1,3))+"-"+alltrim(str(ORD->numord,3))
next
ELSE

endif
sele ord
SKIP
if lote+str(numord,3)>xlote+str(tlfim,3) .or. eof()
li=li+1
@ li,00 say "Registros"
li=li+1
@ li,00 say "Tutor 32"
li=li+1
@ li,00 say "MW Etiquetas, fone (48)265-1251 - "
@ li,00 say xdata

exit
endif
enddo
retu
Responder