4DIS - JavascriptTutorial - Variables

From Unify Community Wiki
(Difference between revisions)
Jump to: navigation, search
Line 21: Line 21:
 
var newVarB = "This is a string";
 
var newVarB = "This is a string";
 
var newVarC : String;
 
var newVarC : String;
var newVarD : String = "This is a String";
+
var newVarD : String = "This is a String.";
  
 
</javascript>
 
</javascript>
Line 30: Line 30:
  
 
<javascript>
 
<javascript>
 +
 +
// Write values :
 +
 +
newVarD = "This is an other string";
 +
 +
newVarD += ".";
 +
 +
// Read values :
 +
 +
var x : String = newVarD;
 +
 +
print ( x );
  
 
</javascript>
 
</javascript>

Revision as of 08:45, 30 October 2011

Javascript Variables

4DIS - JavascriptTutorial - Back


Creating new variables :

<javascript>

/* var ...name...; var ...name... = ...value...; var ...name... : ...type...; var ...name... : ...type... = ...value...;

*/

// examples...

var newVarA; var newVarB = "This is a string"; var newVarC : String; var newVarD : String = "This is a String.";

</javascript>


Using variables :

<javascript>

// Write values :

newVarD = "This is an other string";

newVarD += ".";

// Read values :

var x : String = newVarD;

print ( x );

</javascript>

Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox