Also, be cognitive that ColdFusion converts the words "yes" and "no" into
boolean equivalent 1 and 0.
For code legibility and maintainability, I would agree with Sean C. on this
point of not using implicit boolean conversion.
logically will mean true for any returned records
or false for 0 recor
>>any positive integer evaluates as true in a Boolean expression.
To be more exact: "any *non zero* integer evaluates as true in a Boolean
expression.
although recordcount here cannot be negative.
--
___
REUSE CODE! Use custom tags;
See http://www.contentbox
>>it just seems wrong to me to be evaluating a number as boolean.
In some languages as C for instance, booleans are just numbers,
so there is nothing wrong there.
However, in CF which is a typeless language, I found some instances,
especially with query results, where it is better to be more spe
>Is it a good practice though? I know alot of people do it, but it just
>seems
>wrong to me to be evaluating a number as boolean.
Personally, I like to write code that's as specific as possible. Only if a
variable is to hold a true Boolean value, do I use the syntax.
So, I write the statement as
i've been told (by someone much smarter than me) -not- to use implicit
boolean conversion.
yes, in CF will work (where 0 evaluates to
false and any other number evaluates to true)...but what you really
mean is:
you're looking to see if the recordcount is greater than a specific number.
now, t
Isn't it any non-zero integer? Not just positive ones?
On 9/13/06, Ian Skinner <[EMAIL PROTECTED]> wrote:
>
> It is NOT the same as saying, "as long as there is *one* record returned,
> true".
>
> Right?
>
> Correct, any positive integer evaluates as true in a Boolean expression.
>
>
>
>
Is it a good practice though? I know alot of people do it, but it just seems
wrong to me to be evaluating a number as boolean.
Greg
On 9/13/06, Claude Schneegans <[EMAIL PROTECTED]> wrote:
>
> >>It is NOT the same as saying, "as long as there is *one* record
> returned, true".
>
> Right, and it i
2, 300...
>
> It is NOT the same as saying, "as long as there is *one* record returned,
> true".
>
> Right?
>
--
View this message in context:
http://www.nabble.com/Boolean-use-of-Recordcount-tf2266507.html#a6289
>>It is NOT the same as saying, "as long as there is *one* record
returned, true".
Right, and it is also the same as saying "as long as there is *at least
one* record returned, true".
--
___
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/
is basically the same as saying, "as long as there's at least one record
returned, true". This returns true and steps into the CFIF if the recordcount
is 1, 2, 300...
It is NOT the same as saying, "as long as there is *one* record returned, true".
Right?
--
Jeff Small
LHWH Advertising
M
It is NOT the same as saying, "as long as there is *one* record returned, true".
Right?
Correct, any positive integer evaluates as true in a Boolean expression.
--
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA
-
| 1 | |
- Binary Soduk
11 matches
Mail list logo