Difference between revisions of "TOARRAY()"

From Lianjapedia
Jump to: navigation, search
Line 9: Line 9:
  
 
==Description==
 
==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 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 processed using fixed array functions.
  
 
==Example==
 
==Example==
 
<code lang="recital">
 
<code lang="recital">
 +
myobj = object()
 +
myobj.companyname = "Lianja Inc"
 +
myobj.website = "www.lianja.com"
 +
 +
myfixed = toarray(myobj)
 +
? astring(myfixed)
 +
 +
// Output
 +
Lianja Inc,www.lianja.com
 
</code>
 
</code>
  

Revision as of 08:00, 13 June 2018

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 processed using fixed array functions.

Example

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