NoNameCracksInc

Delphi p backup

Dec 4th, 2013
412
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6. Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7. Dialogs, StdCtrls, ExtCtrls;
  8.  
  9. type
  10. TForm1 = class(TForm)
  11. Button1: TButton;
  12. Image1: TImage;
  13. Button2: TButton;
  14. Button3: TButton;
  15. Label1: TLabel;
  16. Label2: TLabel;
  17. Button4: TButton;
  18. procedure Button1Click(Sender: TObject);
  19. procedure Button2Click(Sender: TObject);
  20. procedure Button3Click(Sender: TObject);
  21. procedure Button4Click(Sender: TObject);
  22. private
  23. { Private declarations }
  24. public
  25. { Public declarations }
  26. end;
  27.  
  28. var
  29. Form1: TForm1;
  30. a:Array[1..10] of Integer;
  31.  
  32. implementation
  33.  
  34. {$R *.dfm}
  35.  
  36. procedure TForm1.Button1Click(Sender: TObject);
  37. var i:Integer;
  38. begin
  39. Image1.Canvas.Rectangle(0,0,Image1.Width,Image1.Height);
  40. Randomize;
  41. for i:=1 to 10 do
  42. begin
  43. a[i]:=random(50);
  44. Image1.Canvas.Textout(20+i*20,20,inttostr(a[i]));
  45. end;
  46. end;
  47.  
  48. procedure TForm1.Button2Click(Sender: TObject);
  49. var o:Integer;
  50. begin
  51. for o:=1 to 10 do
  52. begin
  53. if a[o] mod 2=0 then
  54. Image1.Canvas.Font.Color:=clred
  55. else
  56. Image1.Canvas.Font.Color:=clblue;
  57. Image1.Canvas.TextOut(20+o*20,20,inttostr(a[o]));
  58. end;
  59. end;
  60.  
  61. procedure TForm1.Button3Click(Sender: TObject);
  62. var q:integer;
  63. var min:integer;
  64. var max:integer;
  65. var ox:integer;
  66. begin
  67. min:=50;
  68. max:=0;
  69. for q:=1 to 10 do begin
  70. if a[q]>max then max:=a[q];
  71. if a[q]<min then min:=a[q];
  72. Label1.Caption:=(' Biggast is '+inttostr(max)+' lowast is '+inttostr(min));
  73. ox:=ox+a[q];
  74. Label2.Caption:=(inttostr(ox));
  75.  
  76. end;
  77. end;
  78.  
  79. procedure TForm1.Button4Click(Sender: TObject);
  80. var c:integer;
  81. begin
  82.  
  83. end;
  84.  
  85. end.
Advertisement
Add Comment
Please, Sign In to add comment