I was wondering how people have created structures from queries.  I have a few queries 
that I run that I want to move into one array of structures so that I can sort/display 
them at once instead of three different sort/displays with each query.  This is what I 
have done so far:
    
    <cfset aCategory = ArrayNew(1)>
    
    <cfoutput query="get_Categories">
    <cfset structCat = StructNew()>
    <cfset RESULT = InsertStruct(structCat, "CAT_ID", #cat_id#)>
    <cfset RESULT = InsertStruct(structCat, "CAT_ID", #cat_title#)>
    <cfset RESULT = ArrayAppend(aCategory, structCat)>
    </cfoutput>

(I cut out some of the error catching, etc that I do with RESULT.)

The problem I am having is that when I call the ArrayAppend it does append but I end 
up with only one element in the array even though there are more in the resultset.  
Does this have to do with the fact that in my cfoutput I use the same structure name?  
Is the structure being copied into the array by value or by reference?  And, is that 
what is messing things up?

I hope that my question/problem is clear!

BTW, if anybody has any better ideas for merging 3 or more queries into one resultset 
I would love to hear them as I might just be going about this whole thing wrong.

TIA, 

Derek Hamilton
Systems Developer


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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