put evaluate and  put quotes around your variable like
<cfset loopcount= 1>
<cfset name1 = "yes">

<cfif evaluate("name#loopcount#") is "yes">
hello
</cfif>


Is that what you are asking?

----- Original Message -----
From: "Chris Giminez" <[EMAIL PROTECTED]>
Newsgroups: cf-talk
To: <[EMAIL PROTECTED]>
Sent: Monday, June 19, 2000 12:28 PM
Subject: modifying variable names in a loop


> I have a form that may have just one or up to 20 or so sets of data. The
> form fields will be passed, but could be blank for all but one set up
data.
> It's being passed as something like
>
> form.name1
> form.address1
> form.city1
> form.state1
>
> form.name2
> form.address2
> form.city2
> form.state2
>
> ... so on.
>
> On the action page, I want to loop over an insert query and only execute
the
> query if the set of data is not ""
>
> so I need to do a <cfif name1 is not ""....> run the query<cfelse>don't
run
> the query</cfif>
> How do I run the count in the cfif statement since name#loopcount# won't
> work within a cfif statement?
>
> Then if I do the insert, how can I get the value of the variable for the
> query. It has to be dynamically generated from the loop
> Obviously this is not going to work, but I think it illustrates what I am
> trying to do.
>
>  <CFQUERY NAME="name" DATASOURCE="name">
> INSERT INTO tablename
> (
> name,
> city,
> ...
>
> )
>
> VALUES
>
> (
> #name#loopcount##,
> #city#loopcount##,
> ....
>
> )
>
> </CFQUERY>
>
> Thanks!
>
> --
>
> Chris Giminez
> Owner - Cyber Scriber Web Site Design
> 831-728-4469
> ICQ# 2628000
>
>
> --------------------------------------------------------------------------
----
> 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.
>

------------------------------------------------------------------------------
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