You all have convinced me.
It looks like the operator decides the type for the result for everything except the AND operator.
Even OR works as you say it should.
#1 + true# 2
#true + 1# 2
#1 and true# true
#true and 1# 1
#true or 1# true
#true + true# 2
#true + false# 1
#true & "a"# truea
#"a" & true# atrue
#true and "a"# a
#"a" and true# (error - cannot convert "a" to boolean)
Thanks for explaining it to me.
Jerry Johnson
>>> [EMAIL PROTECTED] 04/20/04 04:20PM >>>
"and" is a boolean operator. I would expect the result to always be a
boolean.
In my opinion, it's a bug.
Sam
----------------------------------------
Blog http://www.rewindlife.com
TeamMM http://www.macromedia.com/go/team
----------------------------------------
> -----Original Message-----
> From: Jerry Johnson [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 20, 2004 4:15 PM
> To: CF-Talk
> Subject: Re: Is it a bug or not a bug?
>
> >>> [EMAIL PROTECTED] 04/20/04 03:55PM >>>
> <snip>
> >Interesting. I would have guessed that both sets would have
> returned the
> >same exact results. That, to me, is indeed a bug.
>
> Dave,
>
> Could you explain why you are sure this is a bug, and not
> just an unexpected casting issue?
>
> Why should #1 and 20# automatically output 1?
>
> You are anding a boolean and an integer, and getting an integer out.
>
> I think it would be a bug if it produced different results
> each time it was called. But it seems to be behaving
> predictably. Which to me means it is not a bug.
>
> Curious,
> Jerry Johnson
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
- Re: Users getting wrong inform... Ben Doom
- Re: RE: Is it a bug or not a bug? Kwang Suh
- Re: Is it a bug or not a bug? Jerry Johnson
- RE: Is it a bug or not a bug? Samuel R. Neff
- RE: Is it a bug or not a bug? Paul Kenney
- Re: Is it a bug or not a bug? Ben Doom
- Re: Is it a bug or not a bug? Claude Schneegans
- Re: Is it a bug or not a bug? Ben Doom
- Re: Is it a bug or not a bug? Claude Schneegans
- Re: Is it a bug or not a bug? Claude Schneegans
- Re: Is it a bug or not a bug? Jerry Johnson
- Re: Is it a bug or not a bug? Ben Doom
- Re: Is it a bug or not a bug? Claude Schneegans
- RE: Is it a bug or not a bug? Barney Boisvert
- Re: Is it a bug or not a bug? Claude Schneegans
- RE: Is it a bug or not a bug? Barney Boisvert
- Re: Is it a bug or not a bug? Claude Schneegans
- Re: Is it a bug or not a bug? Dave Carabetta
- Re: Is it a bug or not a bug? Jerry Johnson
- RE: Is it a bug or not a bug? Gareth Edwards
- Re: Is it a bug or not a bug? Claude Schneegans