Coldfusion - How to loop through an Array of Structure and print out dynamically all KEY values?
问题 Giving the Array of Structure below: I am able to print out all values from all fields by doing: <cfset ColumnNames = structKeyArray(ApiData[1])> <cfset ColumnLength = ArrayLen(ColumnNames)> <cfloop from="1" to="#ArrayLen(ApiData)#" index="i"> <cfdump var="#ApiData[i].Created#"> <cfdump var="#ApiData[i].Name#"> ...and so on Now I am trying to loop through all fields so that I dont have to actually write the name of each field. How do I do this dynamically? Something like: <cfloop from="1" to=