There is a list conversion in there, so it could be just as expensive as
listFind(arraytolist()).  But it's all academic at this point anyway,
whatever works for you works and that's all that matters.  :) 

> -----Original Message-----
> From: Andy Matthews [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, June 01, 2006 9:01 AM
> 
> It was written by Ray...
> 
> Here's the code:
>       function QueryToStructOfStructures(theQuery, primaryKey){
>               var theStructure = StructNew();
>               // remove primary key from cols listing
>               var cols =  
> ListToArray(ListDeleteAt(theQuery.columnlist,
> ListFindNoCase(theQuery.columnlist, primaryKey)));
>               var row = 1;
>               var thisRow = "";
>               var col  = 1;
> 
>               for(row = 1; row LTE theQuery.recordcount; row 
> = row + 1){
>                       thisRow = structnew();
>                       for(col = 1; col LTE arraylen(cols); 
> col = col + 1){
>                               thisRow[cols[col]] = 
> theQuery[cols[col]][row];
>                       }
>                       theStructure[theQuery[primaryKey][row]] 
> = duplicate(thisRow);
>               }
>               return(theStructure);
>       }

This transmission may contain information that is privileged, confidential 
and/or exempt from disclosure under applicable law. If you are not the intended 
recipient, you are hereby notified that any disclosure, copying, distribution, 
or use of the information contained herein (including any reliance thereon) is 
STRICTLY PROHIBITED. If you received this transmission in error, please 
immediately contact the sender and destroy the material in its entirety, 
whether in electronic or hard copy format. Thank you. A1.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:241923
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to