FANDOM


GeneralEdit

  • All class derives from Object class.
  • Case sensitive
  • Compile mode: standard and strict (type checking at compile time)


Comment
  • // single line comment
  • /* multi-line comment */
Variable
  • Declaration: var varname:DataType [=value]
  • Array: var season:Array = ["spring", "summer", "fall", "winter"];
  • Constant: const VARNAME:DataType [=value]
  • XML: var employee:XML = <employee><firstName>Thomas</firstName><lastName>Jefferson</lastname></employee>;

Data TypesEdit

Primitive or Simple
  • String
  • Numeric:
    • Number (any number, integer or floating point -- 64-bit)
    • int (32 bits)
    • uint (32 bits)
  • Boolean': true, false
Complex
  • Array, Date and other classes
Untyped

Untyped variable can have undefined value

  • var someObj:*;
  • var someObj;

PackageEdit

  • optional
  • anything declare inside a package will have internal access modifier
package abc.com
{
   // import statements
   // variable, function, or statements declaration -- public and internal (global or package view)
   // class1 declaration and definition -- public and internal(default) only
   // class2 declaration (the definition has to be placed outside the package. This effectively makes class2 to be visible only through class1)
}

NamespaceEdit

  • optional
  • applicable to function, variable, and constant. A class cannot be placed inside a custom namespace.
  • namespace and access modifier are mutually exclusive -- apply one or the other for function, vars or const.


  1. declare: [public/internal (if declare inside package)] namespace ns1; or namespace ns1="http://dummy/any/string";
  2. use: ns1 function myFunction() {}
  3. reference (to call myFunction):
    1. use namespace ns1;
    2. myFunction();
    or use name qualifier -- ns1::myFunction()

Variable ScopeEdit

  • global
  • class
  • function (this is the minimum; no local or block scope)

CastingEdit

  • Explicit: Use int(xx), uint(xx), Boolean(xx), Number(xx) -- do this with strict mode compile

ClassEdit

  • sealed -- like Java class
  • dynamic -- can have extra properties or methods added during runtime

OperatorEdit

Relational
ischeck data type and return true/false
ascheck data type and return object type or null

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.