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

  1. unit Main;
  2.  
  3. { Program copyright (c) 1995 by Charles Calvert }
  4. { Project Name: RANGER2 }
  5.  
  6. interface
  7.  
  8. uses
  9.   SysUtils, WinTypes, WinProcs, 
  10.   Messages, Classes, Graphics, 
  11.   Controls, Forms, Dialogs, 
  12.   StdCtrls, ExtCtrls, Grids, 
  13.   DBGrids, DB, DBTables;
  14.  
  15. type
  16.   TForm1 = class(TForm)
  17.     Table1: TTable;
  18.     DataSource1: TDataSource;
  19.     DBGrid1: TDBGrid;
  20.     Panel1: TPanel;
  21.     rb1000: TRadioButton;
  22.     rb2000s: TRadioButton;
  23.     rb3000s: TRadioButton;
  24.     rb4000s: TRadioButton;
  25.     rb5000s: TRadioButton;
  26.     rb6000: TRadioButton;
  27.     rb7000: TRadioButton;
  28.     rb8000: TRadioButton;
  29.     rb9000: TRadioButton;
  30.     rb10000: TRadioButton;
  31.     procedure RadioRange(Sender: TObject);
  32.   private
  33.     { Private declarations }
  34.   public
  35.     { Public declarations }
  36.   end;
  37.  
  38. var
  39.   Form1: TForm1;
  40.  
  41. implementation
  42.  
  43. {$R *.DFM}
  44.  
  45. procedure TForm1.RadioRange(Sender: TObject);
  46. var
  47.   S: string;
  48. begin
  49.   Table1.SetRangeStart;
  50.   S := (Sender as TRadioButton).Caption;
  51.   Table1.Fields[0].AsString := S;
  52.   Table1.SetRangeEnd;
  53.   Table1.Fields[0].AsString := IntToStr(StrToInt(S) + 1000);
  54.   Table1.ApplyRange;
  55. end;
  56.  
  57. end.
  58.