home *** CD-ROM | disk | FTP | other *** search
/ Delphi Programming Unleashed / Delphi_Programming_Unleashed_SAMS_Publishing_1995.iso / chap09 / forlist / main.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-03-21  |  639 b   |  40 lines

  1. unit Main;
  2.  
  3. { Program copyright (c) 1994 by Charles Calvert }
  4. { Project Name: FORLIST }
  5.  
  6. { Program shows how to run a simple for loop.
  7.   Also demonstrates listboxes. } 
  8.  
  9. interface
  10.  
  11. uses
  12.   WinTypes, WinProcs, Classes,
  13.   Graphics, Controls, StdCtrls,
  14.   Printers, Forms, SysUtils;
  15.  
  16. type
  17.   TForm1 = class(TForm)
  18.     ListBox1: TListBox;
  19.     Button1: TButton;
  20.     procedure Button1Click(Sender: TObject);
  21.   end;
  22.  
  23. var
  24.   Form1: TForm1;
  25.  
  26. implementation
  27.  
  28. {$R *.DFM}
  29.  
  30.  
  31. procedure TForm1.Button1Click(Sender: TObject);
  32. var
  33.   i: Integer;
  34. begin
  35.   for i := 1 to 25 do
  36.     ListBox1.Items.Add(IntToStr(i));
  37. end;
  38.  
  39. end.
  40.