Jump to content

How do I use ShowProgress if the total value is over 10?


eduardosuruagy

Recommended Posts

Hi,

you can use like this. But in this time you will get 100 requests from clientside to update progressbar. So it is not suitable for web apps. 

 

procedure TMainForm.UniButton1Click(Sender: TObject);
var
  i: Integer;
begin
  ShowProgress('Please Wait...');
  UniSession.Synchronize;

  for i := 1 to 100 do
  begin
    Sleep(500);
    UpdateProgress(i, Format('%%%d Completed', [i]));   
    UniSession.Synchronize;
  end;
  HideProgress;
  ShowToast('Process Finished');
end;

 

Link to comment
Share on other sites

26 minutes ago, Hayri ASLAN said:

Hi,

you can use like this. But in this time you will get 100 request from clientside to update progress. So it is not suitable for web apps. 

 


procedure TMainForm.UniButton1Click(Sender: TObject);
var
  i: Integer;
begin
  ShowProgress('Please Wait...');
  UniSession.Synchronize;

  for i := 1 to 100 do
  begin
    Sleep(500);
    UpdateProgress(i, Format('%%%d Completed', [i]));   
    UniSession.Synchronize;
  end;
  HideProgress;
  ShowToast('Process Finished');
end;

 

I wish if the total was 1000 progress would show from 1 to 100%

if it was 10,20,30,500 or etc. progress showed from 1 to 100%

Link to comment
Share on other sites

2 hours ago, eduardosuruagy said:

I wish if the total was 1000 progress would show from 1 to 100%

If I understand you correctly, for example like this:

procedure TMainForm.UniButton1Click(Sender: TObject);
var
  i: Integer;
begin
  ShowProgress('Please Wait...');
  UniSession.Synchronize;

  for i := 1 to 200 do
  begin
    Sleep(500);
    UpdateProgress(i/200, Format('%%%f Completed', [(i*100)/200]));
    UniSession.Synchronize;
  end;
  HideProgress;
  ShowToast('Process Finished');
end;

 

Link to comment
Share on other sites

1 hour ago, Sherzod said:

If I understand you correctly, for example like this:


procedure TMainForm.UniButton1Click(Sender: TObject);
var
  i: Integer;
begin
  ShowProgress('Please Wait...');
  UniSession.Synchronize;

  for i := 1 to 200 do
  begin
    Sleep(500);
    UpdateProgress(i/200, Format('%%%f Completed', [(i*100)/200]));
    UniSession.Synchronize;
  end;
  HideProgress;
  ShowToast('Process Finished');
end;

 

That's right, but it's still showing 0.5 in 0.5. Can you show from 1% to 1%?

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...