Confirm
From UBot Studio
(Difference between revisions)
(→Example) |
|||
Line 20: | Line 20: | ||
Clicking Yes returns "true", and that is set to a variable. Choosing No returns "false", which is then set to the variable. | Clicking Yes returns "true", and that is set to a variable. Choosing No returns "false", which is then set to the variable. | ||
The variable is then used in the if then else function to determine if the then command should be run or the else command should be run. | The variable is then used in the if then else function to determine if the then command should be run or the else command should be run. | ||
+ | |||
[[File:confirm.png]] | [[File:confirm.png]] |
Revision as of 16:50, 15 April 2013
$Confirm is a System Function.
The function displays a yes/no confirmation box that returns true if yes is chosen.
Example
set(#confirm, $confirm("Click Yes to Type an Item into the field."), "Global") if($comparison(#confirm, "=", "true")) { then { type text(<username field>, "True!", "Standard") } else { type text(<username field>, "False!", "Standard") } }
Running the script prompts a confirm dialog that will wait for you to click Yes or No. Clicking Yes returns "true", and that is set to a variable. Choosing No returns "false", which is then set to the variable. The variable is then used in the if then else function to determine if the then command should be run or the else command should be run.
In this script, choosing Yes types the word "True!" into the first field on the page.
Choosing No types the word "False!" into the firs field of the page.