program progressbar_Console;
uses crt,sysutils;
const lBar=10;
bar100=110;
var i:integer;
procedure pBar(const cp:integer);
var i,n,m:integer;s:string;s1:String;ch:char;
begin
m:=round(100/bar100*cp);
n:=round(lBar/bar100*cp);
s:='[]';
s1:=' '+IntToStr(m)+' % ';
for i:=1 to lBar do
if i<n then ch:=#35 else ch:=#45;
insert(ch,s,pos(']',s));
end;
insert(s1,s,pos('[',s)+1+(lBar div 2));
gotoxy(1,1);writeln(s);
clrscr;
for i:=1 to bar100 do
pBar(i);
delay(50);
end.
program progressbar_Console;
uses crt,sysutils;
const lBar=10;
bar100=110;
var i:integer;
procedure pBar(const cp:integer);
var i,n,m:integer;s:string;s1:String;ch:char;
begin
m:=round(100/bar100*cp);
n:=round(lBar/bar100*cp);
s:='[]';
s1:=' '+IntToStr(m)+' % ';
for i:=1 to lBar do
begin
if i<n then ch:=#35 else ch:=#45;
insert(ch,s,pos(']',s));
end;
insert(s1,s,pos('[',s)+1+(lBar div 2));
gotoxy(1,1);writeln(s);
end;
begin
clrscr;
for i:=1 to bar100 do
begin
pBar(i);
delay(50);
end;
end.