Confirm

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
 
(2 intermediate revisions by one user not shown)
Line 2: Line 2:
  
 
The function displays a yes/no confirmation box that returns true if yes is chosen.
 
The function displays a yes/no confirmation box that returns true if yes is chosen.
 +
 +
'''Message:''' The message that will appear in the prompt.
  
  
Line 18: Line 20:
  
 
Running the script prompts a confirm dialog that will wait for you to click Yes or No.
 
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.
 
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:prmpt0.jpg]]
  
  
 
In this script, choosing Yes types the word "True!" into the first field on the page.
 
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.
 
Choosing No types the word "False!" into the firs field of the page.

Latest revision as of 22:36, 28 December 2016

$Confirm is a System Function.

The function displays a yes/no confirmation box that returns true if yes is chosen.

Message: The message that will appear in the prompt.


[edit] 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.


Prmpt0.jpg


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.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox