This dialog will allow you to get the $chr(#) for anything you enter into the edit box. It will also allow you to add it to the clipboard for ease of use.
*Other version ( limit of 5 and no clipboard function ) http://www.hawkee.com/snippet/4653/
Edit: Clipboard fix from Lindrian. ( notes it was about 4-5 lines shorter than mine ^_^ )
menu channel {
ASC2:dialog $iif($dialog(ASC2), -va, -m) ASC2 ASC2
}
dialog ASC2 {
title "$chr(#) lookup II"
size -1 -1 160 185
edit "" 1, 5 5 85 20, autohs
edit "" 2, 5 30 150 125, multi read vsbar
button "Look Up", 3, 95 5 60 20
button "Clear", 4, 5 160 65 20
button "Send Clipboard", 5, 75 160 80 20
}
on *:dialog:ASC2:*:*: {
if ($devent == init) { did -b $dname 3-5 }
if ($devent == edit) { if ($len($did(1).text) >= 1) { did -e $dname 3 } }
if ($devent == sclick) {
if ($did == 3) { did -r $dname 2 | did -e $dname 4,5 | $asc2($did(1).text).1 }
if ($did == 4) { did -r $dname 1,2 | did -b $dname 3-5 }
if ($did == 5) { clipboard $!+( $+ $left($replace($didtok(ASC2,2,32),$chr(32),$chr(44)),-1) $+ ) }
}
}
alias asc2 {
var %d $+($chr(32),$chr(36),$chr(43),$chr(32),$chr(32))
var %a $did(1).text, %b $len($did(1).text), %c 1
while (%c <= %b) {
didtok ASC2 2 %d $+(%t,$chr(32),$,$+(chr,$chr(40),$asc($mid(%a,%c,1)),$chr(41)))
inc %c
}
did -o ASC2 2 $len($did(ASC2,1).text) $+($,chr,$chr(40),$asc($right($did(ASC2,1).text,1)),$chr(41))
}
Very nice. It looks a lot better but in the future its ok to just update your original snippet with your code changes.
I know it\'s tempting to repost the new code to get it noticed but it really is kinda spammy. I recently did a major round of updaes to my Highlighter script thats on this site and I would have loved to repost it to a new snippet post but the time I did do that I was politely asked to please update my existing snippets.
Anyhow....
Great updates. The only problem I see is when it sends to clipboard it is not including $+\'s.
for instance
$chr(2) $chr(31) $chr(3) $chr(48) $chr(49) $chr(44) $chr(48) $chr(48) $chr(3) $chr(2) $chr(31)
should have been
$chr(2) $+ $chr(31) $+ $chr(3) $+ $chr(48) $+ $chr(49) $+ $chr(44) $+ $chr(48) $+ $chr(48) $+ $chr(3) $+ $chr(2) $+ $chr(31)
Thats the only thing I see thats wrong now.
Well done.