Wouldn't setting a variable in the attributes scope cause it to be defined?

Here's a bit more expanded view of the code:

<cfif variables.errorsFound>
        <cfset attributes.ssn = form.ssn>
        <cfset attributes.lastName = form.lastName>
        <cfset attributes.birthDateYear = form.birthDateYear>
        <cfset attributes.birthDateMonth = form.birthDateMonth>
        <cfset attributes.birthDateDay = form.birthDateDay>
        <cfmodule
                template="login.cfm"
                errorslist="#variables.errorsList#"
                attributeCollection="#attributes#">
        <cfabort>
</cfif>

It errors out on the attributeCollection="#attributes#", line above the
cfabort.

I added in you snippet, and it's working now.  Thanks so much.

I'm just curious as to why setting a var wouldn't create the structure?

<cfif variables.errorsFound>
        <cfif NOT IsDefined("attributes")>
                <cfset attributes = structNew()>
        </cfif>
        <cfset attributes.ssn = form.ssn>
        <cfset attributes.lastName = form.lastName>
        <cfset attributes.birthDateYear = form.birthDateYear>
        <cfset attributes.birthDateMonth = form.birthDateMonth>
        <cfset attributes.birthDateDay = form.birthDateDay>
        <cfmodule
                template="login.cfm"
                errorslist="#variables.errorsList#"
                attributeCollection="#attributes#">
        <cfabort>
</cfif>



>>-----Original Message-----
>>From: Stacy Young [mailto:[EMAIL PROTECTED]]
>>Sent: Wednesday, November 27, 2002 11:41 AM
>>To: CF-Talk
>>Subject: RE: can't refernce #attributes# on cf5?
>>
>>Perhaps the attribute struct is not yet created when that line of code
>>executes. That may cause the error in CF5...and in MX it would auto create
>>the struct if it didn't exist.
>>
>><cfif NOT IsDefined("attributes")>
>>     <cfset attributes = structNew()>
>></cfif>
>>
>>HTH
>>
>>Stace
>>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Reply via email to