From Clomosy Docs
No edit summary |
ClomosyAdmin (talk | contribs) No edit summary |
||
| (8 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
<div class="alert alert-ligth border border-3 border-primary-subtle rounded-5 p-4 shadow-sm" role="alert"> | |||
function InputQuery(const Caption, Prompt: string; var UserValue: string):Boolean; | |||
</div> | |||
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.<br> | 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.<br> | ||
| Line 5: | Line 7: | ||
Use to prompt the user for simple data such as name.<br> | Use to prompt the user for simple data such as name.<br> | ||
<div class="alert alert-danger" role="alert" data-bs-theme="light"> | |||
It is used on Windows and iOS operating systems. | |||
</div> | |||
<b>Example</b><br> | |||
<pre> | |||
var | |||
valueName : string; | |||
{ | |||
repeat | |||
if not InputQuery('Project', 'Please type your name', valueName) | |||
ShowMessage('User cancelled the dialog'); | |||
until valueName <> ''; | |||
ShowMessage('Hello '+valueName); | |||
} | |||
</pre> | |||
<b>Output:</b><br> | |||
[[File:InputQueryExample.png|frameless|400px]] | |||
<h2> See Also </h2> | |||
* [[System_Library#Input-Output_Functions | Input Output Functions]] | |||
{{#seo:|title=InputQuery Using in Clomosy - Clomosy Docs}} | |||
{{#seo:|description=Learn how to use the InputQuery function in Clomosy to display a dialog box for user input, storing the response in a variable for simple data collection.}} | |||
Latest revision as of 11:49, 8 January 2025
function InputQuery(const Caption, Prompt: string; var UserValue: string):Boolean;
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.
It is used on Windows and iOS operating systems.
Example
var
valueName : string;
{
repeat
if not InputQuery('Project', 'Please type your name', valueName)
ShowMessage('User cancelled the dialog');
until valueName <> '';
ShowMessage('Hello '+valueName);
}
