|
|
Joined: Apr 2004
Posts: 66
Babel fish
|
OP
Babel fish
Joined: Apr 2004
Posts: 66 |
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,541
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,541 |
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
|
|
|
|
Joined: May 2004
Posts: 95
Babel fish
|
Babel fish
Joined: May 2004
Posts: 95 |
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: 414
Fjord artisan
|
Fjord artisan
Joined: Apr 2003
Posts: 414 |
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,962
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,962 |
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?
Spelling mistakes, grammatical errors, and stupid comments are intentional.
|
|
|
|
Joined: Dec 2002
Posts: 1,541
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,541 |
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,327
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,327 |
You can also use:
//bset -t &test 1 hello world,, | echo -a $bvar(&test,1-)
Change the part in red to whatever you want.
New username: hixxy
|
|
|
|
Joined: Feb 2003
Posts: 810
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 810 |
alias asc { echo -tagc info * ASCII number for $$1 is $asc($1) } /asc ,
* cold edits his posts 24/7
|
|
|
|
Joined: Nov 2003
Posts: 2,327
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,327 |
Just showing a way to get multiple ascii values instead of repeatly using $asc
New username: hixxy
|
|
|
|
|
|