From Clomosy Docs

No edit summary
No edit summary
Line 12: Line 12:


<b>Example</b><br>
<b>Example</b><br>
<b>TRObject Syntax</b><br>
 
<pre>
<pre>
var
var
Line 24: Line 24:
  ShowMessage('Hello '+valueName);
  ShowMessage('Hello '+valueName);
}
}
</pre>
<b>Base Syntax</b><br>
<pre>
var
valueName : string;
begin
repeat
  if not InputQuery('Project', 'Please type your name', valueName)
  then ShowMessage('User cancelled the dialog');
until valueName <> '';
ShowMessage('Hello '+valueName);
end;
</pre>
</pre>



Revision as of 11:19, 13 November 2024

The InputQuery function displays a simple dialog with the Caption and Prompt message provided. Prompts the user to enter data in a text box in the dialog. If the user presses OK, the entered data is stored in the UserValue variable and the return value is True. If the user cancels the dialog, the return value is False and all entered data is lost.

Use to prompt the user for simple data such as name.

Example

var
 valueName : string;
{
 repeat
   if not InputQuery('Project', 'Please type your name', valueName)
    ShowMessage('User cancelled the dialog'); 
 until valueName <> '';

 ShowMessage('Hello '+valueName);
}

Output:
InputQueryExample.png

See Also