mIRC Homepage
Posted By: gahalle $asc() returns empty for curly braces { } - 26/03/19 01:08 PM
Using v7.55
`$asc({)` and `$asc(})` returns empty values instead of expected 123 or 125.

Reproduced with
`//echo * $asc({) $asc(})`
Posted By: maroon Re: $asc() returns empty for curly braces { } - 26/03/19 02:51 PM
It happens with numerous string identifiers, and not for just this version.

//echo -a $asc(}) ,
//echo -a $asc({) .
result: 44 46

//echo -a $str({,5)
//echo -a $left(},5)
result: 5
//echo -a $str({,5) anything
//echo -a $left(},5) anything
result: $null

//echo -a $sha1({) abc
//echo -a $sha256(}) abc
result: same as $sha1(abc) or $sha256(abc)
//echo -a $len({) abc
result: 3

workaround is:
//echo -a $asc( $({) ) or $asc( $eval({) )
or
//var %a { | echo -a $asc({}
or the one that assumes you already know the answer
//echo -a $asc($chr(123))

You should not expect this next to be 'fixed', as brackets outside parenthesis shouldn't be used, and from the above it doesn't like them inside anything besides $() $eval():
//var %a = } | echo -a %a
//var %a = { | echo -a %a
Thank you for the explanation. I was half expecting brackets to not be featured, but was made uncertain after being able to get an ascii code from doing unexpected inputs with extra characters such as for instance $asc({x).

As for what I need it to do, wrap it in $eval() does look like the way to go around this.

d-(",)z
© mIRC Discussion Forums