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

  1. unit Main;
  2.  
  3. { Program copyright (c) 1994 by Charles Calvert }
  4. { Project Name: FIELDER }
  5.  
  6. interface
  7.  
  8. uses 
  9.   WinTypes, WinProcs, Classes, 
  10.   Graphics, Forms, Controls, 
  11.   StdCtrls, DB, DBTables;
  12.  
  13. type
  14.   TForm1 = class(TForm)
  15.     ListBox1: TListBox;
  16.     bFields: TButton;
  17.     ListBox2: TListBox;
  18.     bCurRecord: TButton;
  19.     Table1: TTable;
  20.     procedure bFieldsClick(Sender: TObject);
  21.     procedure bCurRecordClick(Sender: TObject);
  22.   private
  23.     { Private declarations }
  24.   public
  25.     { Public declarations }
  26.   end;
  27.  
  28. var
  29.   Form1: TForm1;
  30.  
  31. implementation
  32.  
  33. {$R *.DFM}
  34.  
  35. procedure TForm1.bFieldsClick(Sender: TObject);
  36. var
  37.   i: Integer;
  38. begin
  39.   ListBox1.Clear;
  40.   for i := 0 to Table1.FieldCount - 1 do
  41.     ListBox1.Items.Add(Table1.Fields[i].FieldName);
  42. end;
  43.  
  44. procedure TForm1.bCurRecordClick(Sender: TObject);
  45. var
  46.   i: Integer;
  47. begin
  48.   ListBox2.Clear;
  49.   for i := 0 to Table1.FieldCount - 1 do
  50.     ListBox2.Items.Add(Table1.Fields[i].AsString);
  51. end;
  52.  
  53. end.
  54.