All pastes #742086 Raw Edit

Someone

public text v1 · immutable
·published 2007-10-19 06:27 UTC
rendered paste body
dialog asc { 
  title "Ascii Converter" 
  size -1 -1 221 70 
  option dbu 
  edit "", 1, 6 6 71 27, multi autovs 
  edit "", 2, 89 6 127 62, read multi autovs vsbar 
  button "Copy", 3, 6 41 34 12 
  button "Close", 4, 47 41 34 12, cancel 
  button "Clear", 5, 28 55 34 12 
} 
on *:DIALOG:asc:edit:1: { 
  if (!$did(asc,1)) { did -ra asc 2 } 
  elseif ($len($did(asc,1)) == 1) { did -ra asc 2 $!chr( $+ $asc($did(asc,1)) $+ ) } 
  else { did -ra asc 2 $!+( $+ $left($regsubex($regsubex($str(-,$did(asc,1).lines),/-/g,$did(asc,1,\n)),/(.)/g,$!chr( $+ $asc(\1) $+ ) $+ $chr(44)),-1) $+ ) } 
} 
on *:DIALOG:asc:sclick:3: { clipboard $regsubex($str(-,$did(asc,2).lines),/-/g,$did(asc,2,\n)) } 
on *:DIALOG:asc:sclick:5: { did -r asc 1,2 | did -f asc 1 } 
menu * { 
  Ascii Converter { dialog -m asc asc } 
}

alias Ascii {
  if ($dialog(Ascii_Chart)) {
    dialog -voea Ascii_Chart Ascii_Chart
  }
  else { dialog -moda Ascii_Chart Ascii_Chart }
}
dialog Ascii_Chart {
  title "Ascii Table"
  size -1 -1 105 90
  option dbu
  list 1, 5 5 40 65, size
  text "Doubleclick wanted character to send it to clipboard.",2,50 5 50 30, center
  text "¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯", 3, 50 30 50 30, center
  text "Quick help with $chr()'s.", 4, 50 35 50 30, center
  link "http://KingsKrown.co.nr/", 5, 40 75 60 10
  button "Close", 6, 5 75 30 10, ok flat
}

on *:dialog:Ascii_Chart:init:*: {
  var %i 1
  while (%i <= 255) {
    did -a Ascii_Chart  1 $chr(%i) = %i
    inc %i
  }
}
on *:dialog:Ascii_Chart:dclick:*: {
  if ($did == 1) {
    clipboard $left($did(1).seltext,1)
  }
  if ($did == 4) {
    ascii_refresh
  }
  if ($did == 5) {
    .Run http://KingsKrown.co.nr/ 
  }
}
menu * {
  Ascii Table:Ascii
}