EDIT: Skip down 2 posts and read that first. This still has information that you can read, but the post below explains some new findings regarding this issue that supercede what I wrote here and in the first post below.

You're missing the point. If |'s are treated by mIRC's interpreter as $crlf for all intents and purposes, then your codes break down to the following:

Code:
alias whatever { echo -a 1
  ;echo -a 0
  echo -a 1 }


As you can see, the ; comments the full "line" of code, just like normal.

Code:
alias test {
  if (1 == 2) { noop
    noop
    ;noop }
  elseif (1) echo -a ok 
}


As you can see here, ; also comments the full "line" of code, which includes a ; . If you were to write the code like this (without |'s), you would expect the ; to comment out everything on the line including the } .

Right now, it looks like mIRC is not doing anything special with the ; . It is treating it just like it is always treated when at the beginning of a line. A | acts like a new line. There is no special coding for it when it's in the middle of a line.

If a change was made, then the ; would act differently in different instances and that's rarely a good idea in a programming/scripting language. You would have the ; comment EVERYTHING on a line in one instance, but only specific things on a "line" in the other instance. Not a good idea, imo.

Yes, it can be done and probably easily. But I just don't think it's a good idea to start making things do different things in different situations.

I think it's a much better idea to have your script use the ; the way it's meant to be handled... it will comment everything on a "line" when used at the beginning of the "line". And a line is anything between a $crlf or a | and the next $crlf or |. If you want your script to work this way, just use another | to show where the line is supposed to end:

Code:
alias test {
  if (1 == 2) { noop | noop | ;noop | }
  elseif (1) echo -a ok 
}


Yes, it looks odd because you don't normally do that, but it's reasonable because without |'s, the } would usually be on the next line anyhow.

Or, if you don't like doing that, I'd recommend an in-line commenting of the sort like /* */ instead. That lets you tell mIRC where to stop the comment.

With your change, if someone comes along and wants to do something like this:

Code:
alias test {
  if (1 == 2) { noop | ;if (2 == 3) { noop } | noop }
  elseif (1) echo -a ok 
}


Then you'd be in the same situation you already are. The user means to comment the nested IF (up to the |), but because you are stopping at the }, which the user probably isn't going to understand, it will instead completel that IF and you'll be left with this...

Code:
alias test { noop
  if (1 == 2) { }
  noop
}
elseif (1) echo -a ok 
}


As you can see, the ELSEIF is no longer part of the alias. In the end, the user will be in the same situation you were in and have to keep testing to figure out why it isn't working.

Last edited by Riamus2; 30/06/11 11:43 AM.

Invision Support
#Invision on irc.irchighway.net