Rick the purpose of setting the type on the arguments going into a function, and the return variables coming out is to make the function more robust. It'll throw errors when you send the wrong type of data in an argument, or if it tries to return something that you dont expect.
You dont HAVE To use that. you can put type="any" or leave the type="" attibute out entirely if you want. I have a method i wrote some time ago that returns a query, or if the query didnt find any records it returns "norecords", which is a string. So teh function has to have type="any" or it will throw errors. In the page calling it, i know i am always going to have something returned, so i put this; <cfset datastuff = component.getAgentData( agentid) /> <cfif isquery( datastuff ) > a display table of the records goes in here. <cfelse> <p>No records were returned </p> </cfif> But the better way to do it is to use the typing - it helps make sure your methods always return the kind of data you're expecting. It would be better for me if i had written that function so it always returns a query regardless of whether or not it finds records. Thats what your <cfquery tag does - it always gives you a query object whether or not it finds records. If it doesnt find any records, it returns a query object with no records in it. I would have been better off if i'd written that function to do the same. But you dont have to. Cheers Mike Kear Windsor, NSW, Australia Adobe Certified Advanced ColdFusion Developer AFP Webworks http://afpwebworks.com ColdFusion, PHP, ASP, ASP.NET hosting from AUD$15/month On Mon, Jun 16, 2008 at 5:13 AM, Rick Faircloth <[EMAIL PROTECTED]> wrote: > In one example project I was working on, I used this > for the cfreturn: > > <cfreturn get_agent /> > > And then I could access any of the query info contained > in the 'get_agent' query by column name back on the calling page. > In other words, I didn't have to specify in <cfreturn> what specific > column I was returning... > > I see you're from Laos, however, you use a phrase 'sabai-dee' that > I learned in Thai. Is that used in Laotian, as well? > > Sawadee, Khrab! :o) > > Thaan khawjai, ruh plow? > > Rick > >> -----Original Message----- >> From: Azadi Saryev [mailto:[EMAIL PROTECTED] >> Sent: Sunday, June 15, 2008 8:53 AM >> To: CF-Talk >> Subject: Re: Learning about cfc's... couple of questions. >> >> it does not matter what your query selects... it matters what from that >> query you are returning... >> you query may select 1 field in 1 row - it will still be a query, and >> you can cfreturn it as such if you want to. >> or your query may return thousands of rows of thousands of columns - but >> you cfreturn a reference to one specific column in one specific row, >> which will be a string/integer/etc/etc >> >> it IS late here in Laos... >> >> Azadi Saryev >> Sabai-dee.com >> http://www.sabai-dee.com/ >> >> >> >> Rick Faircloth wrote: >> > So, let's see if I've got this straight. >> > >> > If I want to use the cfreturn result from a query >> > in a cfc that is only *one* piece of info, >> > (as in 'select username' I don't have >> > to use the returntype of 'query'. >> > >> > But, if I want to access *all* the data returned by a query >> > in a cfc, (as in 'select *' I have to use returntype = 'query'. >> > >> > Correct? >> > >> > Rick >> > >> > >> > >> >> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307547 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

