Re: (true = 1) returns false?
Jason wrote on 06 jun 2006 in microsoft.publi c.inetserver.as p.general:[color=blue]
> "roger" <mothland@btope nworld.com> wrote in message[color=green]
>>
>>
>> Perhaps I am not understanding the problem
>>
>> dim b
>>
>> b = 1
>> if b then Response.Write "true = 1"
>> if b = true then Response.Write "but this doesn't work"
>>
>> gives me the result...
>>
>> true = 1
>>
>> Isn't that what you want?
>>[/color]
>
> Yes. That's exactly what I want, but your example doesn't work that
> way for me when I do it. For me, b = 0 evaluates to false, b = -1
> evaluates to true, and if b equals any other number, then b is neither
> true nor false. Are you sure that code works for you? I mean, did you
> test it? Because if it does, I would be interested to know why it
> works for you and not for me.[/color]
Then why use the internal evaluation?
Using your definition:
if b = 0 then
b = "is false"
elseif b=-1 then
b = "is true"
else
b = "is neither"
end if
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jason wrote on 06 jun 2006 in microsoft.publi c.inetserver.as p.general:[color=blue]
> "roger" <mothland@btope nworld.com> wrote in message[color=green]
>>
>>
>> Perhaps I am not understanding the problem
>>
>> dim b
>>
>> b = 1
>> if b then Response.Write "true = 1"
>> if b = true then Response.Write "but this doesn't work"
>>
>> gives me the result...
>>
>> true = 1
>>
>> Isn't that what you want?
>>[/color]
>
> Yes. That's exactly what I want, but your example doesn't work that
> way for me when I do it. For me, b = 0 evaluates to false, b = -1
> evaluates to true, and if b equals any other number, then b is neither
> true nor false. Are you sure that code works for you? I mean, did you
> test it? Because if it does, I would be interested to know why it
> works for you and not for me.[/color]
Then why use the internal evaluation?
Using your definition:
if b = 0 then
b = "is false"
elseif b=-1 then
b = "is true"
else
b = "is neither"
end if
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Comment