Syntax like that is usually used within an init() method to set a passed variable to the CFCs global variable scope to be used by other methods. When a CFC is cached or called outside of a one shot invoke, this is a must to prevent having to pass the variable in again and again. For example, someone would do the following: <CFSET objectreference=Createobject('component', 'testobject').init('datasourcename')> <CFSET objectreference.getuser(userid)>
In the second line, there is no need to send in the datasource name as it was sent in when the object was created. > 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? > > Thanks > Victor > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:252987 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4