Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Help a newb make this more efficient

$
0
0
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:

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?

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>