1. Computing
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?

©2013 About.com. All rights reserved.