Try this, 
<cfloop index="i" from="1" to="52" step="1">
 <cfoutput>
 <cfset someone = "person#i#">
 <cfset someone2 = form.person>
 #someone# #someone2#<br>
 </cfoutput>
</cfloop>

I put the display in there to test it myself, you can take it out if you
want. There really would be no point in saying person#i# = form.person, then
you may as well just say form.person because you would be doing the same
thing. So if you were gonna do this to a database and there were 52 person
fields you would look the query, but other than that I would need a better
explanation.

Robert Everland III
Web Developer
Dixon Ticonderoga


-----Original Message-----
From: Erika Foster [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 08, 2000 3:05 PM
To: [EMAIL PROTECTED]
Subject: Simple CFSET and loop question.


I'm trying to set 52 variables to the same value.  I'm not familiar with how
loops work, but here's what I've tried and hasn't worked:

<cfloop index="i" from="1" to="52">
 <cfoutput>
 <cfset person#i# = form.person>
 </cfoutput>
</cfloop>

Result:

Just in time compilation error

Invalid parser construct found on line 5 at position 15. ColdFusion was
looking at the following text:

#
Invalid expression format. The usual cause is an error in the expression
structure.

I know it won't work without putting the index inside pound signs.  How do I
set 52 variables - person1, person2, person 3... person52 using this loop?

Thanks,

Erika Foster
engineering-environmental Management
Applications Developer
(505) 866-1654
[EMAIL PROTECTED]

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