Warning: Parameter 1 to Language::getMagic() expected to be a reference, value given in /sda/2/c/digigrids/wiki/includes/StubObject.php on line 58

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 670

Warning: Invalid argument supplied for foreach() in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 671

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 675

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 670

Warning: Invalid argument supplied for foreach() in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 671

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 675

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 670

Warning: Invalid argument supplied for foreach() in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 671

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 675

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 670

Warning: Invalid argument supplied for foreach() in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 671

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 675

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 670

Warning: Invalid argument supplied for foreach() in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 671

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 675

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 670

Warning: Invalid argument supplied for foreach() in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 671

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 675

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 670

Warning: Invalid argument supplied for foreach() in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 671

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 675

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 670

Warning: Invalid argument supplied for foreach() in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 671

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 675
Scripting/Variables/en - DigiWiki

Scripting/Variables/en

De DigiWiki.

(See Also)
 
Ligne 1 : Ligne 1 :
{{Languages|Scripting/Variables}}
{{Languages|Scripting/Variables}}
 +
{{ScriptingNav/en}}
A '''variable''' is a place to store information, like a number or a string.
A '''variable''' is a place to store information, like a number or a string.
Ligne 7 : Ligne 8 :
Some examples:
Some examples:
-
<lsl>integer  count  = 2;            //A whole number
+
<lsl>
 +
integer  count  = 2;            //A whole number
float    measure = 1.2;          //A number with decimal places
float    measure = 1.2;          //A number with decimal places
string  chars  = "Lee";        //Any text within " "
string  chars  = "Lee";        //Any text within " "
Ligne 13 : Ligne 15 :
list    entries = ["A list may contain many types of values such as", 2, 1.2, <0.4, 0.8, 1.6>];
list    entries = ["A list may contain many types of values such as", 2, 1.2, <0.4, 0.8, 1.6>];
vector  vec_2  = <1,6,2>;      //Generally used for position as xyz, but can be used to store 3 numbers to be parsed out later
vector  vec_2  = <1,6,2>;      //Generally used for position as xyz, but can be used to store 3 numbers to be parsed out later
-
rotation _rot    = <1,2,3,4>;    //Can also be used to store 4 numbers to be parsed out later</lsl>
+
rotation _rot    = <1,2,3,4>;    //Can also be used to store 4 numbers to be parsed out later
 +
</lsl>
== Scope of variables ==
== Scope of variables ==
A variable can be limited to only certain parts of the script, depending upon where it is placed.  This placement, and the areas where it is enabled is called the "scope."  Variables that apply to the entire script are called global variables: they are defined at the top of the script above the state declarations.  Variables that are within functions or within nested areas are considered local variables.
A variable can be limited to only certain parts of the script, depending upon where it is placed.  This placement, and the areas where it is enabled is called the "scope."  Variables that apply to the entire script are called global variables: they are defined at the top of the script above the state declarations.  Variables that are within functions or within nested areas are considered local variables.
Ligne 46 : Ligne 49 :
}
}
</lsl>
</lsl>
-
 
-
 
Converting between variable types is know as casting. for example in the script above, the global variable i has a value of 50. This can be cast to a string to send the value as text to the chat window. This can also be done with local variables.
Converting between variable types is know as casting. for example in the script above, the global variable i has a value of 50. This can be cast to a string to send the value as text to the chat window. This can also be done with local variables.
This is commonly used for debugging a script.
This is commonly used for debugging a script.
Ligne 80 : Ligne 81 :
</lsl>
</lsl>
== See Also ==
== See Also ==
-
* [[string]]
+
<ul style="{{NewStyle|column-width|20.5em|moz=*|webkit=*}}">
-
* [[key]]
+
*[[Scripting/Types/string/en|string]]
-
* [[integer]]
+
*[[Scripting/Types/key/en|key]]
-
* [[float]]
+
*[[Scripting/Types/integer/en|integer]]
-
* [[list]]
+
*[[Scripting/Types/float/en|float]]
-
* [[vector]]
+
*[[Scripting/Types/list/en|list]]
-
* [[rotation]]
+
*[[Scripting/Types/vector/en|vector]]
 +
*[[Scripting/Types/rotation/en|rotation]]
 +
</ul>

Version actuelle en date du 2 octobre 2014 à 05:15

Outils personnels
donate
Google Ads