Fórum Não consigo encontrar o erro... por favor, me ajudem... #215033
18/02/2004
0
Eu estou ´tentando´ fazer um progressbar numa statusbar enquanto eu gero um txt. O problema quando eu vou gerar o txt, me dá esse erro:
--------------------------- Debugger Exception Notification --------------------------- Project sqlscritp.exe raised exception class EAccessViolation with message ´Access violation at address 004C68EA(esses numeros variam) in module ´SQLSCRITP.EXE´. Read of address FFFFFFFF´. Process stopped. Use Step or Run to continue. --------------------------- OK Help ---------------------------
O código é esse:
Arquivo := TStringList.Create; Queryexport.First; while not Queryexport.Eof do begin For I:=progressBar1.Min to ProgressBar1.Max do begin ProgressBar1.position:= I; StatusBar1.Repaint; Linha := ´´; For nI := 0 to Queryexport.FieldCount-1 do begin Linha := Linha + trim(Queryexport.Fields[nI].AsString)+´|´; Arquivo.Add( Linha ); Queryexport.Next; end; Arquivo.SaveToFile(´c:\abkt\pedido.txt´); Arquivo.Free; ProgressBar1.Position:=ProgressBar1.Min; StatusBar1.Repaint; end; end;
Por favor, alguém poderia me ajudar com isso???
Bueno
Curtir tópico
+ 0Posts
18/02/2004
Fabio.hc
while not Queryexport.Eof do begin For I:=progressBar1.Min to ProgressBar1.Max do begin ProgressBar1.position:= I; StatusBar1.Repaint; Linha := ´´; For nI := 0 to Queryexport.FieldCount-1 do begin Linha := Linha + trim(Queryexport.Fields[nI].AsString)+´|´; Arquivo.Add( Linha ); Queryexport.Next; end; ProgressBar1.Position:=ProgressBar1.Min; StatusBar1.Repaint; end; Arquivo.SaveToFile(´c:\abkt\pedido.txt´); Arquivo.Free; end;
Gostei + 0
18/02/2004
Bueno
Gostei + 0
18/02/2004
Uhligmichael
Gostei + 0
18/02/2004
Fabio.hc
Além desta obervação do uhligmichael o [b:280ed662ab]next[/b:280ed662ab] também tem que estar fora do for e vc só precisa de 1 for:
while not Queryexport.Eof do begin ProgressBar1.position:= I; StatusBar1.Repaint; Linha := ´´; For nI := 0 to Queryexport.FieldCount-1 do begin Linha := Linha + trim(Queryexport.Fields[nI].AsString)+´|´; Arquivo.Add( Linha ); end; ProgressBar1.Position:=ProgressBar1.Min; StatusBar1.Repaint; Queryexport.Next; end; Arquivo.SaveToFile(´c:\abkt\pedido.txt´); Arquivo.Free;
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)