I think what's happening is that CF is storing the constant true as 1,
and 255 != 1 (obviously).
In the second instance, false == 0, and 255 != 0, so 255 is true
(because in most languages, "not false is true enough").
Try changing "eq true" to "neq false" and see what happens.
--Ben Doom
Nando wrote:
> I just tripped over something a little strange ...
>
> <cfset bitPublish = 255>
>
> With EQ<br>
> <cfif bitPublish EQ true>
> true
> <cfelse>
> false
> </cfif>
>
> <br><br>
>
> Without EQ<br>
> <cfif bitPublish>
> true
> <cfelse>
> false
> </cfif>
>
> If you run this test code on CFMX 6.1, you'll see that the first case
> evaluates to
> false and the second evalutes to true.
>
> using a value of 1 evaluates both to true.
>
> -----Original Message-----
> From: Jeremy Brodie [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 13, 2004 7:12 PM
> To: CF-Talk
> Subject: Re:OT- Sort of Loop in SQL
>
> Mickael,
>
> Igonore the first post. I hit the enter button by accident....
>
> I watned to get back with you to follow up and give you some sort of
> solution. Cursors
> are ment to gather recordsets and allow a programmer to manipulate
> recordsets like
> variables.
>
> create procedure MyProceedure as
>
> declare @office_ID integer
>
> @office_ID =0
>
> declare cursor1 cursor for
> select myfield1, myfield2
> from mytable
>
> open cursor1
>
> fetch cursor1 into @myfield1,@myfield2
>
> while (@@sqlstatus=0)
>
> begin
>
> @office_ID [EMAIL PROTECTED]
> update mytable
> set myfield1 = @myfield1
> [EMAIL PROTECTED]
> //where
>
> if @office_ID =3
> begin
> @office_ID=0
> end
> end
>
> close cursor cursor1
>
> return
> go
>
> > Mickael,
> >
> > You'll need to find out what rights you have to create stored
> > proceedures/user defined functions/triggers on Sybase. Then you'll
> > need to create the program directly on Sybase. Unfortunally, my
> > database knowledge is limited to Access/SQL Server/Oracle/MySQL.
> >
> > As Neil noted, Access does not have this functionality.
> >
> > Jeremy Brodie
> > Edgewater Technology
> >
> > web: http://www.edgewater.com
> > phone:(703) 815-2500
> > email: [EMAIL PROTECTED]
> >
> >
> > > I am using SYBASE and ACCESS. Thanks for the help
>
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
- Re: OT- Sort of Loop in SQL Mickael
- Re:OT- Sort of Loop in SQL Jeremy Brodie
- Re: Re:OT- Sort of Loop in SQL Mickael
- Re:OT- Sort of Loop in SQL Jeremy Brodie
- Re:OT- Sort of Loop in SQL Jeremy Brodie
- Re:OT- Sort of Loop in SQL Jeremy Brodie
- Strange inconsistancy ... Nando
- RE: Strange inconsista... Barney Boisvert
- RE: Strange inconsista... Nando
- RE: Strange inconsista... Rob Rohan
- Re: Strange inconsista... Ben Doom
- Re: Strange inconsista... Rob Rohan
- RE: Strange inconsista... Barney Boisvert
- RE: OT- Sort of Loop in SQL Taco Fleur
- RE: OT- Sort of Loop in SQL Robertson-Ravo, Neil (RX)
- Re: OT- Sort of Loop in SQL G
- RE: OT- Sort of Loop in SQL Taco Fleur
- RE: Re:OT- Sort of Loop in SQL Robertson-Ravo, Neil (RX)