It seems that you're having trouble referencing the CurrentRow.  You're
confusing the CurrentRow with the Recordcount.  The QueryName.Recordcount
is a single variable that tells you how many records were returned by a
query.  The CurrentRow, references the number of the row returned in a
query loop or cfoutput.  If I misunderstood, I'm sure you can adapt the
code below to your uses.

Rather than having seperate structures for each row, I would put all of
these under a single structure.  Like the following

<cfset myStruct = StructNew()>
<cfloop query="get_mail">
        <cfscript>
                key1 = "Row_" & CurrentRow;
                if (NOT StructKeyExists(myStruct, key1)) {
                        myStruct[key1] = StructNew();
                        }
                myStruct[key1]["name"] = FirstName & " " & LastName;
                myStruct[key1]["email"] = email;
        </cfscript>
</cfloop>

However, if you need seperate structures for some particular reason, this
will work:

<cfloop query="get_mail">
        <cfscript>
                setVariable("MyStruct_#CurrentRow#", StructNew());
                setVariable("MyStruct_#CurrentRow#.name", FirstName & " " & LastName);
                setVariable("MyStruct_#CurrentRow#.email", email);
        </cfscript>
</cfloop>

HTH!

Sharon

P.S., All code untested.


At 05:01 PM 5/9/2000 +0000, Won Lee wrote:
>anyone know how to name structures dyanmically with the currentrow
>from a cfquery?
>
>broken code under 
>
><cfif get_email.recordcount GT 0>
><cfloop query="get_email">
>       <cfscript>
>       currRow = #get_email.recordcount#
>       //MyStructure_currRow = StructNew();
>       SetVariable(MyStructure_currRow, StructNew());
>       StructInsert(MyStructure_currRow, "name",
>"#get_email.FirstName# & #get_email.LastName#");
>       StructInsert(MyStructure_currRow, "email",
>"#get_email.Email#");
>       </cfscript>
></cfloop>
></cfif>
>---------------------------------------------------------------------------
---
>Archives: http://www.eGroups.com/list/cf-talk
>To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
> 

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to