mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
Re: if ($1 ischar) { echo Yes it is! } [Re: westor] #216889
06/12/09 11:39 AM
06/12/09 11:39 AM
Joined: Jul 2007
Posts: 1,129
United States
T
Tomao Offline
Hoopy frood
Tomao  Offline
Hoopy frood
T

Joined: Jul 2007
Posts: 1,129
United States
I think he is asking for an ascii character operator for evaluation purposes. I'm sure you can use regex along with a custom $ischar identifier for that matter:
Code:
alias -l ischar if ($regex($1-,/(\W+)/S)) return $regml(1) 
on *:TEXT:*:?:if ($ischar($1-)) echo -s WARNING: $nick just used $+(",$v1,") in private.
P.S. I know using an alias is unnecessary, but since westor's brought the $v1 up...I thought it'd be for the best.

Re: if ($1 ischar) { echo Yes it is! } [Re: argv0] #216890
06/12/09 12:32 PM
06/12/09 12:32 PM
Joined: Dec 2008
Posts: 1,511
Greece
westor Offline OP
Hoopy frood
westor  Offline OP
Hoopy frood

Joined: Dec 2008
Posts: 1,511
Greece
The Riammus has understand what i mean, I gave you examples but i have not more examples, anyway!


Need Online mIRC help or an mIRC Scripting Freelancer? -> http://westor.ucoz.com/contact <-
Re: if ($1 ischar) { echo Yes it is! } [Re: Tomao] #216893
06/12/09 02:13 PM
06/12/09 02:13 PM
Joined: Jun 2007
Posts: 933
5
5618 Offline
Hoopy frood
5618  Offline
Hoopy frood
5

Joined: Jun 2007
Posts: 933
\W? So basically...
Code:
if ($1- !isalnum)

...except that \W also includes the _ character.

Re: if ($1 ischar) { echo Yes it is! } [Re: 5618] #216902
06/12/09 03:45 PM
06/12/09 03:45 PM
Joined: Mar 2004
Posts: 54
Belgium
Z
Zed Offline
Babel fish
Zed  Offline
Babel fish
Z

Joined: Mar 2004
Posts: 54
Belgium
Code:
if ($len($1-) == 1) && ($1- isalnum) { }

or

if (? iswm $1-) && ($1- isalnum) { }

Re: if ($1 ischar) { echo Yes it is! } [Re: westor] #216904
06/12/09 03:55 PM
06/12/09 03:55 PM
Joined: Oct 2004
Posts: 8,327
MA, USA
Riamus2 Offline
Hoopy frood
Riamus2  Offline
Hoopy frood

Joined: Oct 2004
Posts: 8,327
MA, USA
Originally Posted By: westor
The Riammus has understand what i mean, I gave you examples but i have not more examples, anyway!


Everything I put in that example was correct? It was just basically random. Anyhow, if that was correct, then the examples using $len and isalnum will work fine except for unicode characters. Might not be a bad idea for isalpha and isalnum to match with unicode such as Japanese.

Anyhow, westor, if anything, your requirements would seem to make more sense for adding issymbol instead of ischar. Not only would it make more sense to people as far as what it's checking, but it would work well with the other is___ checks (you'd then have alpha,number,symbol to check and I think that would be all you'd need). Of course, what a symbol is would have to be determined for that and opinions on that may differ from person to person... probably why it's not there.


Invision Support
#Invision on irc.irchighway.net
Page 2 of 2 1 2