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) } if ($did == 4) { did -r $dname 1,2 | did -b $dname 3-5 } if ($did == 5) { clipboard $didtok(ASC2,2,32) } } } alias asc2 { var %a $did(1).text, %b $len($did(1).text), %c 1 while (%c <= %b) { didtok ASC2 2 32 $+(%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)) }