|
|
Cyrex
|
Cyrex
|
I'm not sure if this is a bug or not, but if you do:
//echo -a $asc(,)
mIRC returns:
- * Too many parameters: $asc -
It seems mIRC is parsing the comma as if I was specifying extra parameters. The help file mentions nothing about additional parameters for the $asc() identifier, so I assume this is a bug or flaw.
|
|
|
|
Joined: Dec 2002
Posts: 1,536
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,536 |
Yeah, it's been that way for a while. It would be nice if we could $asc(,) and as you say, nothing makes mention of an additional parameter however, maybe something like $asc(N,0) or something in the future would allow N be treated as text (kind like the $read switch to jjust echo the text rather than perform the commands).
Those who fail history are doomed to repeat it
|
|
|
|
wiebe
|
wiebe
|
you can use //echo -a $asc($?) to get around that
|
|
|
|
Joined: Apr 2003
Posts: 701
Hoopy frood
|
Hoopy frood
Joined: Apr 2003
Posts: 701 |
Even $asc($chr(44)) works  Just as a tool (hex and decimal count): alias chrt {
var %i = 0
window -ln @chrt 0 0 100 500
clear @chrt
while (%i <= 255) {
aline @chrt $+(14,$base(%i,10,16,2),10,$base(%i,10,10,4), $chr(%i))
inc %i
}
window -r @chrt
}
|
|
|
|
Joined: Apr 2003
Posts: 413
Fjord artisan
|
Fjord artisan
Joined: Apr 2003
Posts: 413 |
Yap, that is from long time.. Really annoying 4me.. I use next method.. //set -u0 %temp , | echo -a z $asc(%temp)
But the wiebe solution is just perfect..
|
|
|
|
Joined: Dec 2002
Posts: 2,884
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,884 |
A comma is the parameter delimiter for identifiers, therefore using a comma directly inside any identifier is going to result in it being treated as such. That's not a bug. I would absolutely hate to see this behaviour changed specifically for $asc() or any other identifier. How many times do you see people getting confused or complaining about things in the mIRC language which are inconsistent? Well as it stands the use of commas in identifiers is consistent and I for one am very glad about that. For many identifiers (including $asc()) there is always the possibility that extra parameters could be added, why remove that possibility and make the language inconsistent simply because some people can't be bothered to assign a variable first?
|
|
|
|
Joined: Dec 2002
Posts: 1,536
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,536 |
For many identifiers (including $asc()) there is always the possibility that extra parameters could be added, why remove that possibility and make the language inconsistent simply because some people can't be bothered to assign a variable first?
This is where my idea comes in to add to $asc (as I said above) and give it a "treat this comma as text" switch or something like that [like $read()]. Originaql comments can be found in my previous reply
Those who fail history are doomed to repeat it
|
|
|
|
Joined: Nov 2003
Posts: 2,321
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,321 |
You can also use:
//bset -t &test 1 hello world,, | echo -a $bvar(&test,1-)
Change the part in red to whatever you want.
|
|
|
|
Joined: Feb 2003
Posts: 806
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 806 |
alias asc { echo -tagc info * ASCII number for $$1 is $asc($1) } /asc ,
|
|
|
|
Joined: Nov 2003
Posts: 2,321
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,321 |
Just showing a way to get multiple ascii values instead of repeatly using $asc
|
|
|
|
|
|