How do I create an array with more than three dimensions?

ColdFusion lets you directly create arrays with up to three dimensions using the arrayNew() function. If you want to create a larger array, you can use multiple arrayNew() statements.

<cfset foo = arrayNew(3)>
<cfset foo[1][1][1] = arrayNew(3)>
<cfset foo[1][1][1][1][1][1] = "this is a test">
<cfoutput>#foo[1][1][1][1][1][1]#</cfoutput>

This question was written by Jeremy Petersen
It was last updated on May 15, 2006.

Categories

Data Structures

Comments

comments powered by Disqus