Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.
I am the chief technical officer at InVision App, Inc - a prototyping and collaboration platform for designers, built by designers. I also rock out in JavaScript and ColdFusion 24x7.
Meanwhile on Twitter
Loading latest tweet...
Ben Nadel at cf.Objective() 2009 (Minneapolis, MN) with: Ted Steinman and Tim Meyer

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?




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)>
<cfelse>
<cfthrow message="Could not add a row to '#myQry#' for some reason">
</cfif>

Interesting.

Reply to this Comment

@JFish,

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.

Reply to this Comment

Post A Comment

You — Get Out Of My Dreams, Get Into My Comments
Live in the Now
Oops!
Comment Etiquette: Please do not post spam. Please keep the comments on-topic. Please do not post unrelated questions or large chunks of code. And, above all, please be nice to each other - we're trying to have a good conversation here.