jaytea commented on a Page, Switch Statement in msl  -  Mar 01, 2011

it's a good idea, but unfortunately the syntax required is awkward and imposes too many annoyances on the user such as:

  • the inability to use certain phrases in their commands (such as 'break')
  • the obvious drawback of having to escape command separators and remembering to add '$&' to the end of each line
  • the fact that the entire switch statement spans one single command and is therefore constrained by mIRC's line length limit of 4,150 characters (even, and often more significantly, AFTER evaluation).
  • similarly, the entire switch statement is evaluated at once, resulting in unnecessary and possibly undesired evaluation of pieces of code. some of these may be computationally expensive and some may produce unwanted side effects.

while it is possible to implement this with less awkward syntax and improve upon it by trimming this list of annoyances, we cannot escape the fact that, in mIRC, /goto provides the most simple and efficient switch statement analogy ;P however, like that 'arrays in mIRC' demonstration from a while back, this serves as a fun and thought provoking demonstration

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.