Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.
Ben Nadel at the New York ColdFusion User Group (Nov. 2009) with: Ruslan Sivak
Ben Nadel at the New York ColdFusion User Group (Nov. 2009) with: Ruslan Sivak

ColdFusion Image Manipulation Functions Return Nothing

By Ben Nadel on
Tags: ColdFusion

I have been fooling around with some dynamic image method execution when something I already knew suddenly occurred to me in a different way - ColdFusion image manipulation functions return "Nothing". And, I don't mean that they simply don't return the resultant image object - I mean, just as the documentation states, they return "Nothing" - void. When I realized this, I started to look at all the other ColdFusion methods that don't echo back their primary argument and I realized that it is very hard to find other methods that return Nothing. All of the array and struct methods return true or false depending on success of execution; all the query manipulation methods return properties based on the actions; all other functions return actual values.

Are ColdFusion image manipulation functions the only built-in methods that return no value? And, if so, I wonder why these functions do this?

Looking For A New Job?

100% of job board revenue is donated to Kiva. Loans that change livesFind out more »

Reader Comments

Hmmmm ... you may be right, Ben. Never thought about it, but even the functions I normally use as if they returned nothing, do actually return Boolean. Like the query functions, which I normally don't even assign to anything:

<cfset queryAddRow(myQry)>
<cfset querySetCell(myQry, "myCol", myVal)>

They can just as well be used as:

<cfset rowTest = queryAddRow(myQry)>
<cfif rowTest>
<cfset colTest = querySetCell(myQry, "myCol", myVal)>
<cfthrow message="Could not add a row to '#myQry#' for some reason">



Yeah, when I realized this, I would like, Oh let me go check out things like QueryAddRow() cause those have no return value... but then, it turns out they did.