VBScript If/ElseIf Processing

by "Bastyr University WebMaster" <WebMaster(at)bastyr.edu>

 Date:  Tue, 13 Mar 2001 10:45:58 -0800
 To:  <hwg-techniques(at)hwg.org>
  todo: View Thread, Original
Hello all,

Say I have a vbscript that goes something like:

If i =3D 1 Then=20
    Misc code set 1
Elseif i =3D 2 Then
    Misc code set 2
Elseif i =3D 3 Then=20
    Misc code set 3
End If

where Misc code set # is various other vbscript code.  Now let's say i =3D =
2.

My question is, will the server go through and look at the 'Misc code set' =
code for each item?  It seems that on occasion I've seen that if there is =
a problem with say Misc code set 1, I'll get an error even though that =
if/then was not true.  If it does go through and look at every single line =
of code (used or not), this seems rather inefficient.  Is there some way =
of making this kind of coding more efficient so it steps through these =
quicker and/or ignores unused code?

It may not work this way at all, but thought I'd ask to see if anyone else =
could shed some light.=20

Thanks,

Doug Dossett
Webmaster
Bastyr University
http://www.bastyr.edu

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA