Mark I'm real rusty on this (it's been a while and a lot of C# and
Flex code since then)...


but (IIRC) a query is a struct of arrays where the struct is the
column  and each value of that column an element in the array

I think the confusion is the way that "CFLOOP query=" written has the
implied currentrow within myQuery.column, partly because the column is
not dynamic

when you break out to use the struct (column) name dynamically you
loose the implied current row since what you're saying is

myQuery[column] = myQuery["#column#"] = myQuery["Surname"] (or whatever)

so myQuery[column] becomes an array, not a simple value and ultimately
you can't ToString() an array

hence
> Complex object types cannot be converted to simple values.

yes?


hope this is correct - and helps
barry.b



On 5/22/06, Mark Mandel <[EMAIL PROTECTED]> wrote:
>
> Hey all,
>
> This seems like a stupid question, but I can't seem to figure it
>
> If I have a query, called 'myQuery' I can do:
>
> (1)
> <cfloop query="myQuery">
>    myQuery.column
> </loop>
>
> and it will output fine.
>
> I can do:
> (2)
> <cfset column = "myColumn"/>
> <cfloop query="myQuery">
>    myQuery[column][myQuery.currentRow]
> </loop>
>
> and it will output fine
>
> But if I do:
> (3)
> <cfset column = "myColumn"/>
> <cfloop query="myQuery">
>    myQuery[column]
> </loop>
>
> I get the error:
> Complex object types cannot be converted to simple values.
>
> Is option (2) the only way to handle dynamic column names?
>
> I had thought option 3 would work.. but it doesn't seem to...
>
> Help?
>
> Mark
>
> --
> E: [EMAIL PROTECTED]
> W: www.compoundtheory.com
> ICQ: 3094740
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cfaussie
-~----------~----~----~----~------~----~------~--~---

Reply via email to