4DIS - JavascriptTutorial - Variables

From Unify Community Wiki
(Difference between revisions)
Jump to: navigation, search
m (Text replace - "<javascript>" to "<syntaxhighlight lang="javascript">")
Line 7: Line 7:
 
'''Creating new variables :'''
 
'''Creating new variables :'''
  
<javascript>
+
<syntaxhighlight lang="javascript">
  
 
/*
 
/*
Line 29: Line 29:
 
'''Using variables :'''
 
'''Using variables :'''
  
<javascript>
+
<syntaxhighlight lang="javascript">
  
 
// Write values :
 
// Write values :
Line 49: Line 49:
 
'''Different types of variables :'''
 
'''Different types of variables :'''
  
<javascript>
+
<syntaxhighlight lang="javascript">
  
 
int
 
int

Revision as of 20:47, 10 January 2012

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.";
 
</javascript>
 
----
 
'''Using variables :'''
 
<syntaxhighlight lang="javascript">
 
// Write values :
 
newVarD = "This is an other string";
 
newVarD += ".";
 
// Read values :
 
var x : String = newVarD;
 
print ( x );
 
</javascript>
 
----
 
'''Different types of variables :'''
 
<syntaxhighlight lang="javascript">
 
int
float
doule
String
Rect
Vector3
...
 
</javascript>
Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox