4DIS - JavascriptTutorial - Variables

From Unify Community Wiki
Jump to: navigation, search

Javascript Variables

4DIS - JavascriptTutorial - Back


Creating new variables :

/*
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.";

Using variables :

// Write values :
 
newVarD = "This is an other string";
 
newVarD += ".";
 
// Read values :
 
var x : String = newVarD;
 
print ( x );

Different types of variables :

int
float
doule
String
Rect
Vector3
...
Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox