home *** CD-ROM | disk | FTP | other *** search
/ Delphi Programming Unleashed / Delphi_Programming_Unleashed_SAMS_Publishing_1995.iso / chap16 / linklst2 / entry.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-03-21  |  880 b   |  49 lines

  1. unit Entry;
  2.  
  3. { Program copyright (c) 1995 by Charles Calvert }
  4. { Project Name: LINKLST2 }
  5.  
  6. interface
  7.  
  8. uses
  9.   WinTypes, WinProcs, Classes,
  10.   Graphics, Forms, Controls,
  11.   StdCtrls, Buttons, MakeData,
  12.   SysUtils;
  13.  
  14. type
  15.   TEntryForm = class(TForm)
  16.     Edit1: TEdit;
  17.     Edit2: TEdit;
  18.     Edit3: TEdit;
  19.     Label1: TLabel;
  20.     Label2: TLabel;
  21.     Label3: TLabel;
  22.     BitBtn1: TBitBtn;
  23.     BitBtn2: TBitBtn;
  24.   private
  25.     { Private declarations }
  26.   public
  27.     function Add(var Current: PMyNode): Boolean;
  28.   end;
  29.  
  30. var
  31.   EntryForm: TEntryForm;
  32.  
  33. implementation
  34.  
  35. {$R *.DFM}
  36.  
  37. function TEntryForm.Add(var Current: PMyNode): Boolean;
  38. begin
  39.   if ShowModal = mrOk then begin
  40.     Current^.Name := Edit1.Text;
  41.     Current^.Flight := StrToInt(Edit2.Text);
  42.     Current^.Day := Edit3.Text;
  43.     Result := True
  44.   end else
  45.     Result := False;
  46. end;
  47.  
  48. end.
  49.