Language Objects

Top  Previous  Next

CellScript defines a number of objects. Objects are called static objects if there is only one global object, and instance objects if you can create more than one, assigned to variables (each an instance of the object).

 

These are the top-level objects defined by CellScript. In addition, the Cell will define additional objects to interact with its hardware -- see the Cell documentation for more information.

 

Object

Type

Description

Array

instance

An instance of an array.

DateTime

static

Provides static functions for manipulating date & time.

File

both

Manage files on flash storage.

Math

static

Higher math functions and constants.

Number

instance

Manipulation of numeric variables.

Persist

static

Allows you to save values in permanent (non-volatile) memory.

Scheduler

static

Schedule single or recurring events.

Share

static

Allows you to save values that can be accessed by any running script.

String

both

Manipulation of string variables.

 

Objects have members that are accessed with the member reference operators . and []. Static objects can have members that are constants, functions, properties, or objects. Instance objects can have members that are methods or properties. Methods are like functions, but they operate on the object instance.

 

Static objects are referenced using the name of object. Instance objects are referenced using the variable containing the instance.

 

Examples

var x = Math.PI;

static constant

3.14...

var y = Math.cos(x);

static function

-1.0

var str = String.fromCharCode(0x41, 0x42)

static function

"AB"

x = str.length

instance property

2

y = str.toLowerCase()

instance method

"ab"