TOARRAY()

From Lianjapedia
Jump to: navigation, search

Purpose

Function to load a dynamic array / object into a fixed array

Syntax

TOARRAY(<object>)

See Also

AADD(), AAVERAGE(), ACLASS(), ACOPY(), ADDPROPERTY(), ADEL(), ADESC(), ADIR(), AELEMENT(), AFIELDS(), AFILL(), AINS(), ALEN(), AMAX(), AMEMBERS(), AMIN(), APPEND FROM ARRAY, ARRAY(), ASIZE(), ASORT(), ASTORE(), ASTRING(), ASUBSCRIPT(), ASUM(), COMPOBJ(), COPY TO ARRAY, CREATEOBJECT(), DECLARE, DEFINE CLASS, DIMENSION, DISPLAY CLASSES, DODEFAULT(), FOREACH, GATHER, GETMEMBER(), GETPARAMETER(), IN_ARRAY(), IS_ARRAY(), LIST CLASSES, LOADOBJECT(), LOCAL, NAMESPACE, NAMESPACE(), NEWOBJECT(), OBJECT(), PRINT_HTML(), PRINT_JSON(), PRINT_R(), PRINT_XML(), PRIVATE, PUBLIC, RELEASE, REMOVEPROPERTY(), REQUIRE_ONCE(), RESTORE, SAVE, SAVEOBJECT(), SCATTER, SET EXACT, SQL SELECT, WITH

Description

The TOARRAY() function is used to create a fixed array and load it with the contents of the specified dynamic array or object, <object>. The array returned by the TOARRAY() function can then be manipulated using the fixed array processing functions.

Example

myobj = object()
myobj.companyname = "Lianja Inc"
myobj.website = "www.lianja.com"
 
myfixed = toarray(myobj)
? astring(myfixed)
 
// Output
Lianja Inc,www.lianja.com