mIRC Homepage
Posted By: TheRecliner $pos - 11/12/02 10:12 PM
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 !
Posted By: Dana Re: $pos - 12/12/02 04:39 AM
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)
Posted By: Sojourn Re: $pos - 12/12/02 11:57 AM
$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) = "
© mIRC Discussion Forums