On 9/13/06, Victor Moore <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have seen in a number of examples the following:
>
> <cfset variables.myVar = arguments.someArg />
> any particular reason/advantage why the arguments are assigned to a local
> variable inside a cfc function instead of using it directly?
>

In that example, variables.myVar is not *local*. It's *global* to the
CFC such that *any* method in that CFC has access to its value. Now,
if the code said:

<cfset var myVar = arguments.someArg />

then that might just be for creating a short-hand reference to the value.

In CFCs, the "variables" scope is global, meaning that any method of
the CFC (and any sub-classes, by the way), has access to its value. If
you want a truly local variable for a method, use the "var" setting,
as noted above.

Regards,
Dave.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:252986
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to