I solved it with the first couple of posts help.
New code:
cffunction name=isStudentEmployee returntype=boolean hint=Method to
determine if the person logged in is a student or pro staffer, will corelate to
a control structure if student employee throw up access denied
Awesome! :)
On 1/26/2011 1:31 PM, Adam Bourg wrote:
I solved it with the first couple of posts help.
New code:
cffunction name=isStudentEmployee returntype=boolean hint=Method
to determine if the person logged in is a student or pro staffer, will
corelate to a control structure if
On Wed, Jan 26, 2011 at 11:31 AM, Adam Bourg adam.bo...@gmail.com wrote:
I solved it with the first couple of posts help.
cfif isStudentEmployee.recordcount eq 0
cfreturn true
cfelse
cfreturn false
/cfif
Glad you got it working.
You can tighten that
Charlie, is this true only when the return type is Boolean?
Otherwise, it should return the actual recordcount, right?
Thanks, Che
You could also drop the comparison itself since CF does implicit boolean
conversion.
cfreturn isStudentEmployee.recordcount /
^That'll do the same thing.
Actually, these will not return the same value.
Lets assume the query returns 0 records.
cfreturn isStudentEmployee.recordcount = 0 / will return true
cfreturn isStudentEmployee.recordcount / will return false
On Wed, Jan 26, 2011 at 1:43 PM, Charlie Griefer
charlie.grie...@gmail.com wrote:
Well, it will return the actual recordcount... which is a number. But
CF implicitly converts numeric values to boolean values. Any non-zero
value is true, while any zero value is false.
So given the following code:
cfif myCFC.myMethod()do something/cfif
... assuming myMethod returns a numeric
Let me correct that.
cfreturn isStudentEmployee.recordcount = 0 / will return true
but
cfreturn isStudentEmployee.recordcount / will evaluate to false
On Wed, Jan 26, 2011 at 2:06 PM, Scott Stroz boyz...@gmail.com wrote:
Actually, these will not return the same value.
Lets assume the query
d'oH! Good catch.
So if you go the implicit boolean conversion route, switch the return
true for return false...
On Wed, Jan 26, 2011 at 12:06 PM, Scott Stroz boyz...@gmail.com wrote:
Actually, these will not return the same value.
Lets assume the query returns 0 records.
cfreturn
One last note. You need to var scope your query.
cfset var isStudentEmployee = /
cfquery name=isStudentEmployee
~|
Order the Adobe Coldfusion Anthology now!
On Wed, Jan 26, 2011 at 10:43 AM, Charlie Griefer
charlie.grie...@gmail.com wrote:
cfreturn isStudentEmployee.recordcount = 0 /
Unless I'm missing something, this should be:
cfreturn isStudentEmployee.recordcount eq 0 /
--
Ezra Parker
On Wed, Jan 26, 2011 at 12:30 PM, Ezra Parker e...@cfgrok.com wrote:
On Wed, Jan 26, 2011 at 10:43 AM, Charlie Griefer
charlie.grie...@gmail.com wrote:
cfreturn isStudentEmployee.recordcount = 0 /
Unless I'm missing something, this should be:
cfreturn isStudentEmployee.recordcount eq 0 /
11 matches
Mail list logo