Advertisement
asmodeus94

pasekLadowania

May 18th, 2012
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 1.05 KB | None | 0 0
  1. program pasekLadowania;
  2. uses crt, graph;
  3. var  x,Karta, Tryb : smallint;
  4. const st='d:\bgi';
  5. function obetnij(lancuch:string;aktProc:real):string;
  6. var c : byte;wyn : string;
  7. begin
  8.  wyn:='';
  9.  for c:=1 to 4 do begin
  10.      if lancuch[c]<>'.' then wyn:=wyn+lancuch[c];
  11.  end;if aktProc<10 then wyn:=lancuch[1]+lancuch[2];if aktProc=100 then wyn:=wyn+'0';
  12.  wyn:=wyn+'%';
  13.  obetnij:=wyn;
  14. end;
  15. procedure pasek;
  16. var
  17. proc : real;dx:integer;st : string;bylEnter : byte;
  18. begin
  19.  dx:=0;bylEnter:=0;
  20.  REPEAT
  21.  setlinestyle(1,1,3);setfillstyle(9,blue);
  22.  bar3d((getmaxx-500)div 2,getmaxy div 2,(getmaxx-500)div 2+dx,getmaxy div 2-50,10,true);
  23.  dx:=dx+1;
  24.  proc:=(dx/500*100);
  25.  str(proc,st);
  26.  setlinestyle(0,1,1);bar((getmaxx+4) div 2,getmaxy div 2-25,(getmaxx+55) div 2,getmaxy div 2-17);
  27.  outTextxy((getmaxx-3) div 2,(getmaxy-50) div 2,obetnij(st,proc));
  28.  if keypressed then bylEnter:=1;
  29. UNTIL (dx=500)OR(keypressed);
  30. {if bylEnter=0 then delay(3000);cleardevice;}
  31. end;
  32. begin
  33. Karta:=VGA;
  34. Tryb:=vgahi;
  35. initGraph(Karta, Tryb,st);
  36. pasek;   readkey;
  37. closegraph;
  38. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement