Hector,

On your first example, output = false simply means that it’s not rendering any 
html to the browser.  It has nothing to do with a function returning a value.  
However, I’ve never seen anyone return a value onApplicationStart.

On your second example, output must be true, assuming the siteFooter.cfm has 
html it’s expecting to show the user.  Returntype is void because it’s not 
returning a value.

An example of a function that would return a value would be something like:

<cfset bLoggedIn = IsUserLoggedIn(iUserID)>

That function would have some type of code that checks a database or cookies or 
session variables decides if the user is in fact logged in and responds with 
true or false to the calling script.  Output would be false here because that 
function doesn’t need to write output to the browser.

-Steve

From: [email protected] [mailto:[email protected]] On Behalf Of 
Hector Torres
Sent: Monday, August 03, 2015 9:46 AM
To: Houston ColdFusion Users' Group
Subject: [houcfug] ReturnType and Output on a function

I am a bit confused with this, as I am still getting back to Coldfusion after a 
long time of not working with it.

Why return true as the return value on this function if the output is equal to 
false?

<cffunction name=”onApplicationStart” returnType=”boolean” output=”false”>
<!--- When did the application start? --->
<cfset application.appStarted = now()>
<cfreturn true>
</cffunction>


Why set the returnType to void on this one?

<cffunction name=”onRequestEnd” returnType=”void” output=”true”>
<!--- Display our Site Footer at bottom of every page --->
<cfinclude template=”SiteFooter.cfm”>
</cffunction>

Thanks in advance,
--
--
You received this message because you are subscribed to the "Houston ColdFusion 
Users' Group" discussion list.
To unsubscribe, send email to 
[email protected]<mailto:[email protected]>
For more options, visit http://groups.google.com/group/houcfug?hl=en

---
You received this message because you are subscribed to the Google Groups 
"Houston ColdFusion Users' Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.

-- 
-- 
You received this message because you are subscribed to the "Houston ColdFusion 
Users' Group" discussion list.
To unsubscribe, send email to [email protected]
For more options, visit http://groups.google.com/group/houcfug?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"Houston ColdFusion Users' Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to