House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home / Groups / ColdFusion Newbie (CF-Newbie)

alternatives to evaluate in cfloop

Author:
Rob Voyle
04/04/2012 11:20 PM

Hi Ray Still no go. Just to avoid confusuion I changed the index to items so I don't get confused with variable scope. <cfloop list="#variableNames#"  index="items" delimiters = ","> and then <cfif structKeyExists(form, items) and form[items] is ""> doesn't generate any appropriate error messages when an entry is ommitted. When I just use <cfif form[items] is ""> I get the scope error (same if I use variables[items] Thanks for you help on this. Rob On 4 Apr 2012 at 21:56, Raymond Camden wrote: > Woah - this is way bad. > > > > <cfloop list="#variableNames#"  index="variableNames" delimiters = > ","> > > You can't say "use variable x as a list and make an index x too" - > it > overwrites the value. If variableNames is your list, you want > something else for index, like, variable perhaps. > > <cfloop list="#variablenames# "index="variable"> > > Then you can do > > <cfif structKeyExists(forms, variable) and forms[variable] is ""> > >


Search cf-newbie

May 23, 2013

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Designer, Developer and mobile workflow conference