Progressbar

0

Mam taki kod:

memo1.Text:= StringReplace(Edit1.Text, '0', '1',[rfReplaceAll, rfIgnoreCase]);

Jak pokazać ten proces na progressbar?
Dzieki

0

Zastąp StringReplace jakąś własną funkcją...

0

a co robi ta funkcja ?

0

ehhh, spróbuj tak:

var i:integer;

progressbar.max:=memo1.Lines.Count;

for i:=0 to memo1.Lines.Count-1 do
  begin
     if memo1.text[i]='0' then memo1.text[i]:='1';
     progressbar.position:=i;
     Application.ProcessMessages;
  end;

0

ehhh, spróbuj tak:

var i:integer;

progressbar.max:=memo1.Lines.Count;

for i:=0 to memo1.Lines.Count-1 do
  begin
     if memo1.text[i]='0' then memo1.text[i]:='1';
     progressbar.position:=i;
     Application.ProcessMessages;
  end;

a nie powinno być:

progressbar.max:=length(memo1.Text);

for i:=0 to length(memo1.Text) do
  begin
     if memo1.text[i]='0' then memo1.text[i]:='1';
...

???

1 użytkowników online, w tym zalogowanych: 0, gości: 1