Looping issues. Hi Guys, I need to create a few loops and I'm having trouble trying to find the best way to do it. I want to set INDEX and loop through the following statements, replacing the numeric value with index. I know in some instances that for the FORM. variables, I can use StructKeyExists and I will do that. I already cleared that up in another thread.
But as I researched this, I found that (according to cfDocs @ Adobe) structkeyexists only works on form and url scopes. So I'm not sure how this applies to regular variables and query results. otherwise, I wouldn't be asking. =) I'm at work right now and not in a position to just fiddle with the code, but will later tonight and was hoping maybe someone could chime and clear things up for me. Basically, some of the instances where #index# will be used is in the name of a query variable. aka. myquery_1.my_column = myquery_#index#.my_column normally i could just use structkeyexists, but cfDocs says only Form and URL variables... http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=functions_s_27.html EX. 1 <CFSET photo_file_1_error = 0> <CFSET photo_caption_1_error = 0> <CFSET photo_file_2_error = 0> <CFSET photo_caption_2_error = 0> = loop from 1 to 20 <CFSET photo_file_#index#_error = 0> <CFSET photo_caption_#index_error = 0> EX. 2 <CFPARAM NAME="FORM.photo_1_select_for_action" default="no"> <CFPARAM NAME="FORM.caption_1" default="#photo_info_1.caption#"> <CFPARAM NAME="FORM.photo_file_2" default=""> <CFPARAM NAME="FORM.photo_2_select_for_action" default="no"> = loop from 1 to 20 <CFPARAM NAME="FORM.photo_#index#_select_for_action" default="no"> <CFPARAM NAME="FORM.caption_#index#" default="#photo_info_#index#.caption#">
-- Open BlueDragon Public Mailing List http://www.openbluedragon.org/ http://twitter.com/OpenBlueDragon mailing list - http://groups.google.com/group/openbd?hl=en !! save a network - please trim replies before posting !!
