Mid-reply to your other message, Sean, this one came in.
Naturally it is something quite silly. In fact, I have upgraded today to 6.1, so I can use the variables scope, though I may simply prepend my internal variables with some sort of designator; yet it seems somewhat odd to me that in 6.0 the "unnamed scope" does not take precedence over the arguments scope! Oh, well. At least I don't have all thirty of my components for this new application built yet... just the security framework objects.
Refactor, recode, reuse. All afternoon, apparently.
Thanks for the help.
--
Eric C. Davis
Programmer/Analyst I
Georgia Department of Transportation
Office of I.T. Applications
Web Applications Group
404.463.2860.158
[EMAIL PROTECTED]
-----Original Message-----
From: Sean A Corfield [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 14, 2003 1:46 PM
To: [EMAIL PROTECTED]
Subject: Re: [CFCDev] Persistence of unnamed-scope
On Thursday, Aug 14, 2003, at 10:41 US/Pacific, Davis, Eric wrote:
> My user.cfc and login/process.cfm don't work well, regardless.
Now we see the code, we can point out the error:
> ������� <cffunction name="login" hint="Log the user into system"
> returntype="boolean" output="No">
> ������� ������� <cfargument name="username" required="Yes"
> type="string" />
> ������� ������� <cfargument name="password" required="Yes"
> type="string" />
> [snip]
> ������� ������� ������� username = arguments.username;
You have a name conflict between the unnamed scope and the arguments
scope here - and arguments scope takes precedence! That means the above
statement is equivalent to:
arguments.username = arguments.username;
i.e., it doesn't do anything.
You have two choices:
1. Upgrade to CFMX 6.1 and use "variables" scope for non-public data
(recommended)
2. Use the "instance" idiom:
<!--- in pseudo-constructor --->
<cfset instance = structNew()>
<!--- in code --->
<cfset instance.username = arguments.username>
(and use "instance." everywhere instead of the unqualified scope).
Sean A Corfield -- http://www.corfield.org/blog/
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).
