How To Call A Void ColdFusion Function With No Arguments

1.3k Views Asked by At

I'm writing a ColdFusion function that is the following:

<cffunction name="checkStatusCode" output="false" access="private" returnType="void">
    <cfif result.Responseheader.Status_Code eq "400">
        <cfset isBadRequest = true>
    </cfif>
</cffunction>

It is both void and contains no parameters; I understand how I would call it if it had parameters and returned something; I'd simply put the code in a <cfset> tag. I simply want to run the function. What tags do I need to put it in?

1

There are 1 best solutions below

1
On BEST ANSWER

Either this:

<cfset checkStatusCode()>

or, if you are using cfscript,

checkStatusCode();

You could probably use <cfinvoke> if you tried hard enough.