Ask a Question related to Dreamweaver AppDev, Design and Development.
-
Marja Ribbers #1
[ASP/VBscript] Strange handling of Or comparisons
Suppose I have the following test in ASP/VBscript:
If (IsEmpty(l_sAppVar) Or l_sAppVar = "" Or DateDiff("d", CDate(l_sAppVar), Date()) > 0) Then
...
End If
then ASP complains about a type mismatch for CDate(l_sAppVar) when l_sAppVar is indeed "".
This seems strange to me, because when the first or second evaluation in the test returns True, then it is not necessary anymore to evaluate the other components of the test.
Am I missing something?
--
Marja Ribbers-de Vroed
Company website:
[url]www.webwaresystems.nl[/url]
Dreamweaver extensions:
[url]www.flevooware.nl/dreamweaver/[/url]
Marja Ribbers Guest
-
Strange 404 error handling on Apache web server
My group recently pulled out of hosting, and now we're on a Solaris server running Apache 1.3.29 (A bit behind the times, but I've got no control... -
comparisons and depth
sorry to post two questions in one day, but i have run into a second problem. i have a looping movie clip which changes _y position randomly with... -
#26080 [NEW]: Comparisons always true in xml.c
From: AxelLuttgens at swing dot be Operating system: Darwin 7.0.0 (Panther) PHP version: 4.3.3 PHP Bug Type: Compile Warning... -
chaining comparisons
When I learned python I was overjoyed that I could evaluate 1 < 2 < 3 and get "true". I just realized that you can't do that in Ruby. Is there a... -
Date comparisons
Hi. I'm using ADO.NET to retrieve data from SQL Server via stored procedures. Lately I found the following problem: There's a stored procedure... -
bthouin #2
Re: [ASP/VBscript] Strange handling of Or comparisons
Marja,
In many languages and compilers, evaluation of a condition
- either starts with the last term
- or does all evaluations regardless of result
So I guess you'll have to check first in a separate if the l_sAppVar is
empty or not.
regards
Bernard
Marja Ribbers wrote:> Suppose I have the following test in ASP/VBscript:
>
> If (IsEmpty(l_sAppVar) Or l_sAppVar = "" Or DateDiff("d", CDate(l_sAppVar), Date()) > 0) Then
> ...
> End If
>
> then ASP complains about a type mismatch for CDate(l_sAppVar) when l_sAppVar is indeed "".
>
> This seems strange to me, because when the first or second evaluation in the test returns True, then it is not necessary anymore to evaluate the other components of the test.
> Am I missing something?
>bthouin Guest
-
Julian Roberts #3
Re: [ASP/VBscript] Strange handling of Or comparisons
You'd need to nest the statements. eg
if boo then
if foo then
end if
end if
--
Jules
[url]http://www.charon.co.uk/charoncart[/url]
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004
Julian Roberts Guest
-
Marja Ribbers #4
Re: [ASP/VBscript] Strange handling of Or comparisons
I know how to work around this, but it just seemed strange to me that an Or comparison would be processed this way.
--
Marja Ribbers-de Vroed
Company website:
[url]www.webwaresystems.nl[/url]
Dreamweaver extensions:
[url]www.flevooware.nl/dreamweaver/[/url]
"Julian Roberts" <newsg@charon.co.uk> wrote in message news:d1sea7$b5e$1@forums.macromedia.com...> You'd need to nest the statements. eg
>
> if boo then
> if foo then
>
> end if
> end if
>
> --
> Jules
> [url]http://www.charon.co.uk/charoncart[/url]
> Charon Cart 3
> Shopping Cart Extension for Dreamweaver MX/MX 2004
>
>
>Marja Ribbers Guest



Reply With Quote

