Loop não está funcionando
16/06/2008
0
baixo a minha procedure. As linhas com aspas(quote) não funciona, ou seja, eu consigo carregar a variavel texto com vazio(´´), mas não entra no break. Porque será?
procedure TForm1.CarregaCupom;
var
i:Integer;
positem:Boolean;
texto:String;
begin
if inicupom then
begin
positem := False;
k := AnsiPos(´ITEM CÓDIGO ST´,s);
if k <> 0 then
begin
loop := true;
Readln(Arq,s);
while loop do
begin
Linha.Add(´60´ + StrZero(StrToInt(texto),2));
// Linha.Add(´60´ + StrZero(StrToInt(texto),2) + StrZero(StrToInt(Copy(s, 4,4)),4)+
// StrZero(StrToInt(Copy(s,);
Readln(Arq,s);
k := AnsiPos(´SUBTOTAL R$´,s);
if k <> 0 then
ISubTot := ´60´ + StrZero(StrToInt(LimpaTexto(Copy(s,k+38,18))),18);
end;
loop := false;
end;//Meios de pagto
end;//Fim do inicupom }
end;
procedure TForm1.CarregaCupom;
var
i:Integer;
positem:Boolean;
texto:String;
begin
if inicupom then
begin
positem := False;
k := AnsiPos(´ITEM CÓDIGO ST´,s);
if k <> 0 then
begin
loop := true;
Readln(Arq,s);
while loop do
begin
for i := 1 to length(s) do
begin
texto := s[i];
if texto = ´´ then
break;
end;Linha.Add(´60´ + StrZero(StrToInt(texto),2));
// Linha.Add(´60´ + StrZero(StrToInt(texto),2) + StrZero(StrToInt(Copy(s, 4,4)),4)+
// StrZero(StrToInt(Copy(s,);
Readln(Arq,s);
k := AnsiPos(´SUBTOTAL R$´,s);
if k <> 0 then
ISubTot := ´60´ + StrZero(StrToInt(LimpaTexto(Copy(s,k+38,18))),18);
end;
loop := false;
end;//Meios de pagto
end;//Fim do inicupom }
end;
Paulo
Curtir tópico
+ 0
Responder
Posts
16/06/2008
Edilcimar
Quem é S? Onde está o local onde você dá um valor ao mesmo?
Responder
16/06/2008
Paulo
Achei o erro. Eu deveria dar um espaço no (´ ´) e não havia feito, então ele interpretou como Nulo e não vazio. Valeu!!!!
Responder
Clique aqui para fazer login e interagir na Comunidade :)