home *** CD-ROM | disk | FTP | other *** search
/ Delphi 4 Bible / Delphi_4_Bible_Tom_Swan_IDG_Books_1998.iso / source / Strings / Input.pas next >
Encoding:
Pascal/Delphi Source File  |  1998-02-13  |  390 b   |  19 lines

  1. procedure TForm1.Button1Click(Sender: TObject);
  2. var
  3.   S: String;
  4. begin
  5.   S := InputBox('Test', 'Enter a string', '');
  6.   if Length(S) > 0 then
  7.     ShowMessage('You entered: ' + S);
  8. end;
  9.  
  10. procedure TForm1.Button2Click(Sender: TObject);
  11. var
  12.   S: String;
  13. begin
  14.   S := '';
  15.   if InputQuery('Test', 'Type QUIT to end', S) then
  16.     if Uppercase(S) = 'QUIT' then
  17.       Close;
  18. end;
  19.