Skip to main content
Ben Nadel at InVision In Real Life (IRL) 2018 (Hollywood, CA) with: Jeremy Mount
Ben Nadel at InVision In Real Life (IRL) 2018 (Hollywood, CA) with: Jeremy Mount

ColdFusion Image Manipulation Functions Return Nothing

By
Published in Comments (2)

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

140 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.

15,902 Comments

@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.

I believe in love. I believe in compassion. I believe in human rights. I believe that we can afford to give more of these gifts to the world around us because it costs us nothing to be decent and kind and understanding. And, I want you to know that when you land on this site, you are accepted for who you are, no matter how you identify, what truths you live, or whatever kind of goofy shit makes you feel alive! Rock on with your bad self!
Ben Nadel