domingo, 3 de maio de 2009

Xml - Clarion - Buscar Numero lote

-?xml version="1.0" encoding="utf-8"?>
-DadosLoteNfe>
-NumeroLoteGerado>87-/NumeroLoteGerado>
-/DadosLoteNfe>

grupo_txt FILE,DRIVER('ASCII'),OEM,NAME(fdarquivo),PRE(gru_txt),CREATE,BINDABLE,THREAD
Record RECORD,PRE()
grupo string(@s255)
END
END
Numero_Lote string(@n010)

open(grupo_txt)
set(grupo_txt)
loop
next(grupo_txt)
if errorcode()
break
else
if gru_txt:grupo[1,1:18]=''-NumeroLoteGerado>'
a#=1
numero_lote=0
loop
IF NOT NUMERIC(gru_txt:grupo[19,1:a#])
break
else
numero_lote=gru_txt:grupo[19,1:a#]
a#+=1
end
end
message(numero_lote)
end!Final if
end!Final if
end!Final Loop