mIRC Home    About    Download    Register    News    Help

Print Thread
#90660 16/07/04 04:49 AM
Joined: Apr 2004
Posts: 66
C
Cyrex Offline OP
Babel fish
OP Offline
Babel fish
C
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.

#90661 16/07/04 04:52 AM
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
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
#90662 16/07/04 08:15 AM
Joined: May 2004
Posts: 95
W
Babel fish
Offline
Babel fish
W
Joined: May 2004
Posts: 95
you can use //echo -a $asc($?) to get around that

#90663 16/07/04 09:46 AM
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
Even $asc($chr(44)) works grin

Just as a tool (hex and decimal count):
Code:
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
}


#90664 16/07/04 10:23 AM
Joined: Apr 2003
Posts: 414
Fjord artisan
Offline
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..


mIRC Chm Help 6.16.0.3 Full Anchored!
#90665 16/07/04 12:11 PM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
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.
#90666 16/07/04 12:38 PM
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
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
#90667 16/07/04 12:59 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
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
#90668 17/07/04 08:52 PM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
Code:
alias asc { echo -tagc info * ASCII number for $$1 is $asc($1) }

/asc ,


* cold edits his posts 24/7
#90669 18/07/04 02:00 AM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Just showing a way to get multiple ascii values instead of repeatly using $asc smile


New username: hixxy

Link Copied to Clipboard