![]() |
Dial_GetInput |
Returns the contents of (one of) the input fields. This makes it easy to get the result without parsing.
Syntax
Dial_GetInput ( switches )
Parameters
switches | specify which input data from the last dialog is returned |
Switches
Switches can be set to:
-Text1 | this will return the text of the first input field (from the top) from the last dialog |
-Text2 | this will return the text of the second input field (from the top) from the last dialog |
-Text3 | this will return the text of the third input field (from the top) from the last dialog |
…
-Text20 | this will return the text of the 20th input field (from the top) from the last dialog |
Alternatively you can add this switch:
-AllText | the result is a list of all texts items, separated by a return character. |
To modify the list result you can add any of these switches:
-DontAddEmptyLines | don’t include empty lines |
-ReturnAtEnd | add a return at the end |
Returned Result
Data type returned
Text
Result
The text of the specified input field, from the last dialog shown.
Originated in
Troi Dialog Plug-in 3.0
Compatibility
FileMaker Pro 17 to FileMaker Pro 21 (2024)
Considerations
The text of the input field(s) is saved by the plug-in until a next dialog is displayed. Please be aware that each dialog function of the plug-in resets the text. Dialogs that have no input field(s) will set the text to “”. (This is to be able to extend the functionality of these functions in the future).
When the FileMaker application stops, the input data is reset to “”.
See also the function Dial_GetButton.
v12.0 added 3 new switches:
Example
Set Field [ gUsername ; Dial_GetInput ( "-Text1" ) ]
This will put the data of the first input field of the last dialog shown, for example “John”, in the global field gUserName.
Set Variable [ $ResultList ; Dial_GetInput ( "-AllTexts -DontAddEmptyLines" ) ]
This will set $ResultList with a list of all the input fields, not including lines of fields that were left blank. The result may be similar to:
John
Cupertino
USA
Example 2
This example will show an an input dialog with 5 input fields. We use the Get-Input function to easily get the data out. We assume that in your FileMaker file the following fields are defined:
Name Text
Address Text
City Text
Zip Text
Country Text
result Global, text
Add the following script steps:
Set Field [ result ; Dial_InputDialog ( "-NoteIcon" ; 5 ;
"Please enter your personal data:" ; "OK" ; "Cancel" ; ) ]
If [ Dial_GetButton ( "" ) = 1 ]
Set Field [ Name ; Dial_GetInput ( "-text1" ) ]
Set Field [ Address ; Dial_GetInput ( "-text2" ) ]
Set Field [ City ; Dial_GetInput ( "-text3" ) ]
Set Field [ Zip ; Dial_GetInput ( "-text4" ) ]
Set Field [ Country ; Dial_GetInput ( "-text5" ) ]
End If
Example 3
This example will show a list dialog with 1 input field. We use the Get-Input function to easily get the data out. We assume that in your FileMaker file the following fields are defined:
FlavourChosen Text
result Global, text
Add the following script steps:
Set Field [ result ; Dial_ListDialog ( "-NoteIcon" ; "Please select a fruit:" ; "OK" ;
"Cancel" ; "Help" ; "Stop" ; "Apple|Pear|Lemon" ) ]
Set Field [ FlavourChosen ; Dial_GetInput ( "-text1" ) ]
Used in example file
Input.fmp12
Related functions
Dial_BigInputDialog |
Dial_GetButton |
Dial_InputDialog |
Dial_ListDialog |
Dial_SetInput |
Related topics
Troi Dialog Plug-in online help (overview)