I have made a script that pulls the PC IP address, compare the 2nd octect number and open a website based on that comparison. The problem is that it has to be compared to nealy 90 sites and it makes for one large If .. .EndIf. Here is a snippet of the code:
this continues till the final ElseIF comparison.
How can this be more efficient?
If Number ($Octet[2]) = 118 Then run ("c:\Program Files\Internet Explorer\IEXPLORE.EXE http://website/common/welcome.jsp?site=101") ElseIf Number ($Octet [2]) = 123 Then run ("c:\Program Files\Internet Explorer\IEXPLORE.EXE http://website/common/welcome.jsp?site=102") ElseIf Number ($Octet [2]) = 195 Then run ("c:\Program Files\Internet Explorer\IEXPLORE.EXE http://website/common/welcome.jsp?site=105")
this continues till the final ElseIF comparison.
How can this be more efficient?