Delphi Programming

  1. Home
  2. Computing & Technology
  3. Delphi Programming
Glossary|Tips/Tricks|FREE App/VCL|Best'O'Net|Books|Link Back

Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
 

InputQuery

unit
Dialogs
category
Dialog and Message routines

declaration
function InputQuery(const ACaption, APrompt; var Value: string): boolean;

description
InputQuery displays an input dialog box that enables the user to enter a string.

ACaption is the caption of the dialog box, APrompt the text that prompts the user to enter input in the edit box, and Value appears in the edit box when the dialog box first appears.

InputQuery returns True if the user chooses OK (Value contains the changed string), and False if the user chooses Cancel or presses the Esc key.

example
uses Dialogs;
...
var s, name : string;
    r:boolean;

s := 'default name';
r := InputQuery('Name input',
                'Please enter your name', s);

if r then Showmessage('Your name is: ' + s)
else ShowMessage('User canceled the input!');

in real code

see also
InputBox,


 Free Delphi code snippet inside every Delphi Newsletter!
Subscribe to the Newsletter
Name
Email

 Got some code to share? Got a question? Need some help?

Explore Delphi Programming

About.com Special Features

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

Easy ways to connect two computers for networking purposes. More >

Delphi Programming

  1. Home
  2. Computing & Technology
  3. Delphi Programming

©2009 About.com, a part of The New York Times Company.

All rights reserved.