[thelist] Re: if...or...then in asp

Anthony Baratta Anthony at Baratta.com
Mon Feb 25 16:15:01 CST 2002


At 01:18 PM 2/25/2002, Scott Dexter wrote:
> >
> > Untrue. VBScript, at least in scripting engine 5.5, does NOT
> > use short-circuit evaluation.
>
>That is correct. VBScript has *never* done short-circuit evals. It
>evaluates the entire expression, always....

Well....I sit corrected. ;-)

Now I gotta dig up that article or reference that made me think that way in
the first place.

<tip author="Anthony Baratta" subject="Comparing Strings versus Numbers">

Here's a quick ASP function that will allow you to compare Numbers to
Numbers and Strings to Strings:

    FormatCompare(valueOne,valueTwo) =/</</<=/>= _
       FormatCompare(valueTwo,valueOne)

function FormatCompare(sOne,sTwo)
     if (isNumeric(Trim(sOne)) AND isNumeric(Trim(sTwo))) then
         FormatCompare = CDbl(Trim(sOne))
     else
         FormatCompare = Trim(sOne)
     end if
end function

</tip>
----
Anthony Baratta
President
Keyboard Jockeys

"Conformity is the refuge of the unimaginative."




More information about the thelist mailing list