mIRC Home    About    Download    Register    News    Help

Print Thread
#1171 11/12/02 10:12 PM
Joined: Dec 2002
Posts: 1
T
Mostly harmless
OP Offline
Mostly harmless
T
Joined: Dec 2002
Posts: 1
Hello,

i have a little question,

is it possible to use the $pos function to search a "(" or a ")" or also a quote : "
confused

In advance Thanks !

#1172 12/12/02 04:39 AM
Joined: Dec 2002
Posts: 144
D
Vogon poet
Offline
Vogon poet
D
Joined: Dec 2002
Posts: 144
Yes, there are actually two ways to do this.

First, you can set the character that you want into a variable and then use that variable in the $pos:
Code:
var %x = (
echo -a $pos(stringhere,%x,1)

You can also use the $asc value of the character:
Code:
echo -a $pos(stringhere,$asc(40),1)

The values for the characters you asked for:
( - $asc(40)
) - $asc(41)
" - $asc(34)


"Any sufficiently advanced technology is indistinguishable from magic." - Arthur C. Clarke
#1173 12/12/02 11:57 AM
Joined: Dec 2002
Posts: 17
S
Pikka bird
Offline
Pikka bird
S
Joined: Dec 2002
Posts: 17
$asc() returns the ASCII value of a character wink You'd want to be using $chr() in the examples above:

$chr(40) = (
$chr(41) = )
$chr(34) = "


Link Copied to Clipboard