mIRC Home    About    Download    Register    News    Help

Print Thread
#199886 23/05/08 05:33 PM
Joined: Oct 2003
Posts: 214
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Oct 2003
Posts: 214
mIRC 6.32

Anything BEHIND $* attached to it using $+ vanishes:
Quote:
Code:
tokenize 32 a b c | echo * $+($*,m00h)

Output:
* a
* b
* c
Code:
tokenize 32 a b c | echo * $* $+ m00h

Output:
* a
* b
* c


Anything before $* attaching it to something, changes to ascii-trash:
Quote:
Code:
tokenize 32 a b c | echo * $+ $*

Output:
*`~$*
*`~$*
*`~$*

Reported this long time ago already and wasn't fixed so far. (can't find the post)

I know i can work around it, using aliases but it's a bug as it doesn't reply the text as it should.


one step closer to world domination
Sephiroth_ #199890 23/05/08 07:01 PM
Joined: May 2007
Posts: 37
C
Ameglian cow
Offline
Ameglian cow
C
Joined: May 2007
Posts: 37
This is due to the strange way $* evaluates. I'd hesitate to call it a bug, since the evaluation routine is obviously deliberate.

What is happening is that in each of your test cases, the $* is being evaluated last - AFTER the $+. So going through the order of evaluation:

Code:
echo * $+($*,m00h)


The $+() evaluates to:

Code:
echo * $*m00h


The m00h is ignored in the same way it would be with an identifier like $+, the $* evaluates to either a, b or c, and is subsequently echoed.

As I'm sure you're aware, the two possible work-arounds are as follows (using your examples):

Code:
//tokenize 32 a b c | scon -r echo * $* $!+ m00h
//tokenize 32 a b c | scon -r echo * $!+( $* ,m00h)


The /scon re-evaluates the whole line, so that in each case the $* is evaluated BEFORE the $+() or $+.

The second problem, `~$* is also due to the way the $* is handled by the engine. For some reason, mIRC does an internal replacement of $* to `~$* before evaluating anything else. You effectively catch the engine halfway through, and concatenate the string after the $* is replaced, but before it is evaluated for each token.

Hope that makes sense, I waffled a bit crazy

Chessnut #199980 25/05/08 12:57 PM
Joined: Dec 2007
Posts: 48
K
Kol Offline
Ameglian cow
Offline
Ameglian cow
K
Joined: Dec 2007
Posts: 48
Speaking of $*, what was fixed with it =S

Sephiroth_ #199981 25/05/08 01:07 PM
Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
The $* is a really old, and somewhat quirky, identifier. It was added at a time when mIRC did not support while and goto loops. Some users may still find it useful however I purposefully removed it from the Help file because it really doesn't fit in with how all other identifiers work. I'd really rather not fiddle with it - that would likely lead to breaking some other aspect of its non-standard behaviour :-]

Kol #199993 25/05/08 02:30 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
//tokenize 32 1 2 3 | echo -a $* $(a)

Previous versions would turn $* into `~*$ (or whatever it is) but this version works ok with the above situation.


Link Copied to Clipboard