>Well - first off you don't need the evaluates in there - you can use normal
>notation.  

I'll try that, thanks.  I try to not use it when I can('t).

>Something like this.

><cfset the_db = StructNew()>
this should've been:
<cfset the_db = StructNew()>
for it's use below.

><cfoutput query="#CurQuery#">
>   <cfloop list="#the_db_name.columnlist#" index="col">
>      <cfset the_db_info[col] = the_db_name[col][currentRow]>
>   </cfloop>
></cfoutput>
>
>Once that's set I'm confused... you're looping over a known column list so
>how could any be column name be "undefined"?

It's not the column name that's undefined, but it's contents; in other words, 
empty, but not an empty quotes.  It's the right side of <cfset the_db_info[col] 
= the_db_name[col][currentRow]>

>I guess I'm confused with "the_db_info" variable and what it does... as it
>is in your current code it's being used as an indexed object, but it's never
>declared as one... 

yeah, I meant it to be defined by the structNew on the first line.

>even if it were it would end up overwritten with the last
>of row of data in any multi-row recordset.

That's ok.  This is just going to loop through the recordset and display the 
data so I use the same struct for each record, display it and then go on.

>To convert a one-row recordset to a struct (which is sorta what your code is
>doing) I would do this (this will also work for multi-row record sets but
>will only convert the first row):
>
><cfset MyStruct = StructNew() />
><cfloop list="#CurQuery.columnlist#" index="CurCol">
>       <cfset MyStruct[CurCol] = CurQuery[CurCol][1] />
></cfloop>

Mine looks like this except for the evaluates and the currentrow that I use.  
I'm going to loop through several records so I think my currentrow use is 
correct.  
I have eliminated the evaluates.  They were there because I was using the 
database name as a string.  I realized I should set the val to the database 
instead.  
I think I still need to use the string though for the <cfoutput 
query="#the_db_name#"> but I should probably take that out of the included file 
and just do the variable setting there.

>Neat, uh?

yep, very much so.  It's making my life much simpler to implement this.

I still have the original problem of testing for undefined.

>I'm not sure if any of that actually addresses your problem... but I hope it
>does!

thanks for answerin'!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:210230
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=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to