Conscious   -  Nov 16, 2012

Code at the bottom. My apologies if BBcode code tags don't work in statuses which I have a suspicion it doesn't!

I'm sick of having to do two lines or $chr() shit if I want a comma in a mIRC identifier parameter. For example, var %reg = /(abc){1,3}/ then a regex line using $regex(,%reg).

So, I decided to make an alias out of it that puts all the parameters together. It works like this so far: $c(1,2,3) = 1,2,3. All good. However, due to the nature of mIRC, whitespaces on either side of the text are being cut out. E.g, $c(a , b, c) should return a , b, c but it returns a,b,c.

Has anyone found a solution to combat this problem?

alias c {
  var %x $1
  tokenize 32 $2-
  while ($1) {
    %x = %x $+ , $+ $1
    tokenize 32 $2-
  }
  return %x
}
Conscious  -  Nov 16, 2012

awesome, it does!

FelicianoX  -  Nov 17, 2012

I think your alias is just a large version of

alias c return $replace($1-, $chr(32), $chr(44))

(As of the time I posted this comment)

Edit: It actually ignores spaces in $1, so:

alias c return $1, $+ $replace($2-, $chr(32), $chr(44))
Conscious  -  Nov 17, 2012

No. I don't want spaces replaced with commas. Parameters might have spaces inside of them. $c(a b c d e,f,g,h) should return a b c d e,f,g,h

FelicianoX  -  Nov 18, 2012

Yeah that's what my second alias is doing.

Sign in to comment

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.