[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Dialogs' (#lcl)

InputBox

Displays a box with defined title and prompt, and expects user input in a text box

Declaration

Source position: dialogs.pp line 514

function InputBox(

  const ACaption: String;

  const APrompt: String;

  const ADefault: String

):String;

Arguments

ACaption

  

The caption for the dialogbox

APrompt

  

The text asking the user for his input

ADefault

  

Default value for dialog box

Function result

The result of this function is the string the user entered in the editbox or the default string .

Description

Displays a box with defined title and prompt, and expects user input in a text box . A default string can optionally be displayed in the text box. The user-entered or default string is returned as the function result.

If the user selects the OK button, the text in the text box is returned. If the user selects the Cancel button, the default string is returned.

See also

ShowMessage

  

Show Message

Example

uses 
  Forms, LCLType, Dialogs, Controls;

procedure TryInputBox;
var 
  userstring: string;
begin
  userstring := InputBox ('Get some text input', 
                          'Please type in some information', 
                          'Some sample text');
  ShowMessage(userstring);
end;

The latest version of this document can be found at lazarus-ccr.sourceforge.net.