Warning:
This tutorial covers only Mobile Widgets versions.
Tiny Mobile Widgets don't support Array..

Array Javascript library

This API allows the Javascript code to support arrays and collections using a "opaque" references.

All references to a structure or a sub-part of a structure must be freed after use as the number of references is limited (max. 32 concurrent references).

This API is only supported on Mobile Widgets version of the MeMo, and should now only be used to support data provided by the Rpc API.
It is not supproted by Tiny Mobile Widgets version.


1.4.0


ref newArray ():
Returns a reference ref to an empty array, or -1 on error.

ref newCollection ():
Returns a reference ref to an empty collection, or -1 on error.

void free (ref):
Free the reference to an array or collection.

void addElement (ref, value, [int at]):
Add a value to an array or collection. The type of value can be either be string, integer, float, boolean, or a reference to another array or collection.
If the reference ref points to an array:

If the reference ref points to a collection:

key setElement (ref, key, value):
Set a value in an array or collection and return key on success or -1 on error. The type of value can be either be string, integer, float, boolean, or a reference to another array or collection. If the reference ref points to an array:

If the reference ref points to a collection:

value getElement (ref, key):
Return a value corresponding to key from the array or collection referenced by ref, or -1 on key is not found in ref.
The type of value can be either be string, integer, float, boolean, or a reference to another array or collection.
If the reference ref points to an array:

If the reference ref points to a collection:

void removeElement (ref, key):
Remove the element at key in ref.

boolean isArray (ref):
Return true if reference ref points to an array.

boolean isCollection (ref):
Return true if reference ref points to a collection.

int size (ref):
Return the number of elements in the array or collection referenced by ref.

Enumeration elements (ref):
Return a new reference to an enumeration for the elements of the array or collection referenced by ref, or -1 on error. To free this reference, you will need to call Enumeration.free(ref).

Enumeration key (ref):
Return a new reference to an enumeration for the keys of the collection referenced by ref, or -1 on error (or if ref is an array). To free this reference, you will need to call Enumeration.free(ref).

void removeAllElements (ref):
Empty completely the array or collection referenced by ref.