|
$asc()
#90660
16/07/04 04:49 AM
|
Joined: Apr 2004
Posts: 66
Cyrex
OP
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.
|
|
|
Re: $asc()
#90661
16/07/04 04:52 AM
|
Joined: Dec 2002
Posts: 1,534
landonsandor
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,534 |
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
|
|
|
Re: $asc()
#90662
16/07/04 08:15 AM
|
Joined: May 2004
Posts: 95
wiebe
Babel fish
|
Babel fish
Joined: May 2004
Posts: 95 |
you can use //echo -a $asc($?) to get around that
|
|
|
Re: $asc()
#90663
16/07/04 09:46 AM
|
Joined: Apr 2003
Posts: 701
Kelder
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
}
|
|
|
Re: $asc()
#90664
16/07/04 10:23 AM
|
Joined: Apr 2003
Posts: 414
Adrenalin
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..
|
|
|
Re: $asc()
#90665
16/07/04 12:11 PM
|
Joined: Dec 2002
Posts: 2,962
starbucks_mafia
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.
|
|
|
Re: $asc()
#90666
16/07/04 12:38 PM
|
Joined: Dec 2002
Posts: 1,534
landonsandor
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,534 |
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
|
|
|
Re: $asc()
#90667
16/07/04 12:59 PM
|
Joined: Nov 2003
Posts: 2,327
tidy_trax
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
|
|
|
Re: $asc()
#90668
17/07/04 08:52 PM
|
Joined: Feb 2003
Posts: 810
cold
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
|
|
|
Re: $asc()
#90669
18/07/04 02:00 AM
|
Joined: Nov 2003
Posts: 2,327
tidy_trax
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
|
|
|
|
|
|