Fickle Posted July 17, 2010 Posted July 17, 2010 (edited) Just for clarification, can multiple Else statements be done? For instance (i took this from the help file):If $var > 0 Then MsgBox(4096,"", "Value is positive.") ElseIf $var < 0 Then MsgBox(4096,"", "Value is negative.") Else If StringIsXDigit ($var) Then MsgBox(4096,"", "Value might be hexadecimal!") Else MsgBox(4096,"", "Value is either a string or is zero.");<----instead of ending it here, could it continue indefinitely ;by continuously adding if else ? EndIf EndIfThe help file says that Switch case would be the best if i wanted to compare 1 expression against multiple values, however, I am confused as to how a switch case works which is why im more inclined to use a if then else statement. If multiple else statements cannot be done, could someone kindly explain how switch case works? Or point me to an easier to understand help file as I am new. Edited July 17, 2010 by Fickle
AdmiralAlkex Posted July 17, 2010 Posted July 17, 2010 Switch and If are the same (just that Switch looks nicer when you have a big one), and no you can't have multiple Else. How would that work anyway? Else runs when everything else is False, so multiple instead of one doesn't make any bloody sense at all. Unless you're talking about ElseIf, but that makes even less sense as the helpfile clearly state that you can have as many as you want, and even far less sense when you remember that it would take you less than a minute to try yourself. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now