Set

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
Line 5: Line 5:
 
The command settings allow you to determine if you want the variable to be:
 
The command settings allow you to determine if you want the variable to be:
  
Local: Specific to the command the variable is set to. It will not affect or be affected by another variable with the same name in a different command.
+
* Local: Specific to the command the variable is set to. It will not affect or be affected by another variable with the same name in a different command.
  
Global: The variable can be used everywhere and will affect and be affected by another variable with the same name in a different command.
+
* Global: The variable can be used everywhere and will affect and be affected by another variable with the same name in a different command.
  
 
== Example ==
 
== Example ==

Revision as of 14:38, 14 April 2013

Set is a Data Command.

This command allows you to store a value in a variable.

The command settings allow you to determine if you want the variable to be:

  • Local: Specific to the command the variable is set to. It will not affect or be affected by another variable with the same name in a different command.
  • Global: The variable can be used everywhere and will affect and be affected by another variable with the same name in a different command.

Example


navigate("http://www.google.com/", "Wait")
set(#color, "yellow", "Local")
type text(<name="q">, #color, "Standard")


The above script will create a variable with the value "yellow" and fill the google search field with the value yellow.

File:Yellowset.png



In the script below, notice that each variable is set locally, and though they both have the same names, they do not affect each other.

One value is Red and the other is Blue.

navigate("http://www.google.com/", "Wait")
define tes2 {
    set(#one, "blue", "Local")
    type text(<name="q">, #one, "Standard")
}
define tes1 {
    set(#one, "red", "Local")
    type text(<name="q">, #one, "Standard")
}
tes1()
tes2()


File:Set.png

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox