If I use the variables scope as suggested below, without the "instance =
structNew();" how to I pass back the structure using cfreturn at the
bottom of my function? I tried <cfreturn this> and was unsuccessful.
> <cffunction name="init" access="public" output="false"
>> returntype="struct">
>> <cfargument name="aid" type="numeric" default="0">
>> <cfscript>
>> instance = structNew();
I think this is bad practice. It's equivalent to:
variables.instance = structNew();
>> instance.id = id;
>> instance.name = "";
Frankly, I'd just use the variables scope directly - omit the
structNew() line above and just do this instead:
variables.id = id;
variables.name = "";
Mark Kecko
Technology Director
MediaPost Communications
[EMAIL PROTECTED]
212-204-2002
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble
Ticket application
http://www.houseoffusion.com/banners/view.cfm?bannerid=48
Message: http://www.houseoffusion.com/lists.cfm/link=i:12:6735
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/12
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:12
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.12
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54