<CF_ArrayDump>

Outputs the contents of any one-dimensional or two-dimensional array, in a simple table format. Similar to the CFX_QueryDump and CFX_ShowQuery tags, but for arrays. Useful for debugging.

Parameters
ARRAY Required. The name of the array you want to display. Must be a 1D or 2D array. If a 2D array, it must be "square" (that is, with an even number of "rows" and "columns").
SHOWLABELS Optional. Yes or No. If SHOWLABELS="Yes", the coordinates of each array cell will be displayed along with its values.

Example
This example runs a query and uses the CFX_ShowQuery tag to display the data returned by the query. Then my CF_QueryToArray tag is used to convert the contents of the query into an array. Finally, the CF_ArrayDump tag is used to output the contents of the new array. You certainly don't need to use any of these other tags to use the CF_ArrayDump tag--they're just here by way of illustration.

<CFQUERY NAME="MyQuery" DATASOURCE="A2Z"> SELECT * FROM Customers </CFQUERY> <CFX_ShowQuery Query="MyQuery"> <CF_QueryToArray QUERY="MyQuery" ARRAY="MyArray" USECFX="Yes"> <CF_ArrayDump ARRAY="MyArray" SHOWLABELS="Yes">

The above code would produce the following output:

CUSTOMERID COMPANY FIRSTNAME MIDDLEINIT LASTNAME ADDRESS1 ADDRESS2 CITY STATE ZIP PHONE EMAIL CUSTOMERSINCE
1ABC CompanyArnoldBCooper123 West 1st Street1st FloorAnywhereNY00001212 555 1212acooper@abc.com1996-07-16 00:00:00
2DEF CompanyDianaEFontaine456 East 2nd StreetSuite 1200AnyplaceNY00002718 555 1212dfontaine@def.com1995-05-05 00:00:00
MyArray[1][1]
1
MyArray[2][1]
ABC Company
MyArray[3][1]
Arnold
MyArray[4][1]
B
MyArray[5][1]
Cooper
MyArray[6][1]
123 West 1st Street
MyArray[7][1]
1st Floor
MyArray[8][1]
Anywhere
MyArray[9][1]
NY
MyArray[10][1]
00001
MyArray[11][1]
212 555 1212
MyArray[12][1]
acooper@abc.com
MyArray[13][1]
1996-07-16 00:00:00
MyArray[1][2]
2
MyArray[2][2]
DEF Company
MyArray[3][2]
Diana
MyArray[4][2]
E
MyArray[5][2]
Fontaine
MyArray[6][2]
456 East 2nd Street
MyArray[7][2]
Suite 1200
MyArray[8][2]
Anyplace
MyArray[9][2]
NY
MyArray[10][2]
00002
MyArray[11][2]
718 555 1212
MyArray[12][2]
dfontaine@def.com
MyArray[13][2]
1995-05-05 00:00:00