troubleshooting Question

issue with coif and evaluate function

Avatar of btintermedia
btintermedia asked on
Web Languages and StandardsCSSColdFusion Language
12 Comments1 Solution316 ViewsLast Modified:
I have the following logic:

<cfloop from="1" to="#norecs#" index="thisrow">
      
      <cfset text_seq = "#evaluate("ts" & thisrow)#">
    <CFSET "alt_type#text_seq#" = "#evaluate("alt_type" & text_seq)#">
    <cfif ("alt_type#text_seq#" eq "") or ("alt_type#text_seq#" eq 'text1')>
    including code for text_inc<br />
   <!--- <cfinclude template="q_text_inc_text1.cfm"> --->
    <cfelseif "alt_type#text_seq#" eq 'spacer'>
    this is a spacer
    <cfelse>
    we are undefined and therefore proceeding to debug mode<br />
    my alt_type#text_seq# = "#evaluate("alt_type" & text_seq)#"<br /><br />
    </cfif>
   
   
   
</cfloop>



1) I am passing the #norecs# and this is working correctly
2) I am passing the #ts# and this is working corruptly,
3) there are 6 records, and the the first four (in the database, are blank for the alt_type, and the last two are "spacer1"
4) The alt_type should resolve to the number of the record/instance (for example, alt_type34) and thus in turn, should be set to it's corresponding hidden field value from the form.
5) I am then executing conditional logic to run application logic based on whether it is blank or if it is set to 'spacer'
6) since everything should resolve to something, I have a debug set to show any record that is set to anything differently.
7) everything defaults to the error - through by debug code shows what I would expect:




we are undefined and therefore proceeding to debug mode
my alt_type34 = ""

we are undefined and therefore proceeding to debug mode
my alt_type38 = ""

we are undefined and therefore proceeding to debug mode
my alt_type39 = ""

we are undefined and therefore proceeding to debug mode
my alt_type47 = ""

we are undefined and therefore proceeding to debug mode
my alt_type49 = "spacer"

we are undefined and therefore proceeding to debug mode
my alt_type50 = "spacer"


I know that is must be something simple - but I am legitimately confused
ASKER CERTIFIED SOLUTION
Brijesh Chauhan
Staff IT Engineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 12 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 12 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros