IsArray(variable) tells you if a given variable is an array...

Since a 2D array is simply an array of an array, then IsArray(variable[1])
will tell you if the given variable has a second dimension (or at least one
in the first element).

Likewise, IsArray(variable[1][1]) would tell you if it was a 3D array.

Hope this helps

Norman Elton

-----Original Message-----
From: JoshMEagle [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 01, 2001 11:24 AM
To: CF-Talk
Subject: How many dimensions in a given array?


How do I test to see how many dimensions a given array posseses? This method
gives me all the values of a 2 dimensional array, but I need to know if it's
a 2D array BEFORE I try this ... unless someone knows a craftier way... ???

<cfset a=1>
<cfset aD=1>
<cfloop condition="a LTE ArrayLen(array)">

        <cfloop condition="aD LTE ArrayLen(arrayHolder[a])">
                <cfoutput>#array[a][aD]#</cfoutput>
        <cfset aD=aD+1>
        </cfloop>

<cfset a=a+1>
<cfet aD=1>
</cfloop>

Any help appreciated!


Joshua Miller
Web Development
Eagle Technologies Group
Technology Solutions for the Next Generation
www.eagletgi.com
[EMAIL PROTECTED]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to