Are scopes case sensitive? If so, I see that you have "mailer.#switchhitter#" as well as "Mailer.#switchhitter#"
-----Original Message----- From: Falls, Brian, CON, OASD(HA)/TMA [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 7:56 AM To: '[EMAIL PROTECTED]' Subject: RE: Slightly O/T Variable Woes Actually, I don't believe that would work in this case. Here is why:(I have commented the code for this email. It still does not work... :P ) <!--- Switchhitter is not actually in the variables scope. ---> <cfloop list="emailsubject|emailmessagetext|emailattachment" index="switchhitter" delimiters="|"> <cfloop from="1" to="#Len(evaluate("mailer.#switchhitter#"))#" index="FoundAtPosition"> <cfset TheLetter = Mid(evaluate("Mailer.#switchhitter#"), FoundAtPosition, 1)> <cfif TheLetter EQ "##" and FoundPound EQ False> <cfset FoundPound = True> <cfelseif TheLetter EQ "##" and FoundPound EQ True and Trim(VariableName) NEQ ""> <cfset VariableArray[VariableNameCounter][1] = Replace(VariableName, "##", "")> <cfset TempVariableName = VariableArray[VariableNameCounter][1]> <cfset VariableArray[VariableNameCounter][2] = "#Evaluate('#TempVariableName#')#"> <cfset VariableNameCounter = VariableNameCounter + 1> <cfset VariableName = ""> <cfset FoundPound = False> <cfelseif FoundPound EQ True> <cfset VariableName = VariableName & "#TheLetter#"> </cfif> </cfloop> <cfif trim(mailer.emailfrom) neq ""> <cfset Variables.EmailFrom = mailer.emailfrom> </cfif> <cfset VariableNameCounter = VariableNameCounter - 1> <cfset Variables.EmailSubject = Mailer.EmailSubject> <cfloop from="1" to="#VariableNameCounter#" index="LoopCounter"> <!--- This line is still erroring out! It says it is at position 9, so that still puts it inside of the "Variables.#switchhitter#" that I was complaining about earlier. I have tried it with "", '', and I even tried using the evaluate function. I know now however that that was futile. It was late(for me)... ---> <cfset "Variables.#switchhitter#" = ReplaceNoCase(evaluate("Variables.#switchhitter#"), "#VariableArray[Loopcounter][1]#", "#VariableArray[LoopCounter][2]#")> </cfloop> <cfset "Variables.#switchhitter#" = Replace(evaluate("Variables.#switchhitter#"), "##", "", "ALL")> </cfloop> </cfoutput> <cfmail to="[EMAIL PROTECTED]" from="#mailer.emailfrom#" subject="#Variables.emailsubject#" type="HTML" cc="">#Variables.emailmessagetext#</cfmail> </cfloop> -----Original Message----- From: Jeff Peters [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 8:15 PM To: [EMAIL PROTECTED] Subject: Re: Slightly O/T Variable Woes And for those who prefer structure notation, the following also works: <cfset variables[switchhitter] = ... - Jeff On 12 Jun 2002 at 16:16, Bob Krieger wrote: > Brian... just ask... > > rewrite it to read <cfset "Variables.#switchhitter#" = ..... > Put the dynamic variable name in quotes > > > Bob Krieger > www.FBTutor.com > The FuseBox Tutor > > > ----- Original Message ----- > From: "Falls, Brian, CON, OASD(HA)/TMA" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, June 12, 2002 3:06 PM > Subject: Slightly O/T Variable Woes > > > > <cfset Variables.#switchhitter#= > > ReplaceNoCase(evaluate("Variables.#switchhitter#"), > > "#VariableArray[Loopcounter][1]#", "#VariableArray[LoopCounter][2]#")> > > > > In the statement above the Variables.#switchhitter# behind the cfset is > > crashing. I have tried using evaluate all kinds of different ways, but > this > > is just escaping me. Switchhitter is the index for a list loop. It loops > > three times to assemble a dynamic email message. I can get the loop to > work > > if this variable is hard coded. I know it is something simple, but it's 20 > > minutes before days end, and I am feeling fried. Can someone throw me a > bone > > here? > > > > Here is the error message: > > Just in time compilation error > > Invalid parser construct found on line 71 at position 18. > > ColdFusion was looking at the following text:. > > Invalid expression format. > > The usual cause is an error in the expression structure. > > > > > > > > > ==^================================================================ This email was sent to: [email protected] EASY UNSUBSCRIBE click here: http://topica.com/u/?bUrFMa.bV0Kx9 Or send an email to: [EMAIL PROTECTED] T O P I C A -- Register now to manage your mail! http://www.topica.com/partner/tag02/register ==^================================================================
