Progress bar in console application in Delphi?

Asked

Viewed 343 times

3

I would like to display some kind of animation in my console application during a long process.

Could be a progress bar or another animation.

  • 1

    Post your application to verify what you have done so far.

  • It’s just a simple console application that scrolls through a text file and would like to display an animation like a bar filling or spinning as I’ve seen in other applications.

  • This can be put on the so-called Delphi, which I know nothing about, https://hongkiat.github.io/html5-progress-bar/

  • To expedite my solution open a topic at: https://stackoverflow.com/questions/47230536/how-to-display-a-progress-bar-in-a-console-application-using-delphi

1 answer

1

Try it like this: I saved this in a file because I was trying to do the same and it worked... I found this in a Forum at the time.

Var 
cont, Linhas : integer; 
Lista: TStringList; 
begin 
  try 
    Lista.LoadFromFile('C:\Cadastro.txt'); 
    Linhas:= Lista.Count; 
  finally 
    Lista.Free; 
  end; 
  ProgressBar1.Max := Linhas; //Envia p/ Progressbar o Tamanho Total do Arquivo de acordo com o numero de linhas pego com a Try acima...

The one above is for Windows this one is for Console... See here

  • 1

    I use it like this and it’s good...

  • 1

    How would this code work there, being in an application CONSOLE?

  • i edited the reply and translated the comments see there...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.