dialog aschar {
  title "ｴ ASCII List ｴ"
  size -1 -1 80 316
  option dbu
  icon saturn.ico
  tab "32 to 145", 1, 1 0 76 203
  tab "146 to 255", 2
  list 3, 3 26 72 176, tab 1 size vsbar
  list 4, 3 26 72 176, tab 2 size vsbar
  edit "", 6, 2 237 25 10, autohs center
  edit "", 8, 50 237 28 10, read autohs center
  edit "", 12, 2 263 25 10, autohs center
  edit "", 14, 50 263 28 10, read autohs center
  button "Trova", 13, 27 263 23 10
  button "Trova", 7, 27 237 23 10
  button "Chiudi", 15, 44 306 35 9
  text "**32 is a space**", 16, 4 17 70 8, tab 1 center
  text "Inserire un numero per trovare il carattere corrispondente.", 5, 2 224 76 13, center
  text "Lista ASCII creata da [F]iRe [A]nGeL. Crediti a Ionis(aka Lureiko/Lyriox) per l'idea copia caratteri.", 9, 1 279 78 26, center
  text "ｩ [F]iRe [A]nGeL", 10, 1 307 42 8, center
  text "Inserire un carattere per trovare il numero corrispondente.", 11, 3 248 75 14, center
  text "Doppio click per copiare un carattere (incolla nel clipboard)", 17, 2 205 76 14, center
  text "覧覧覧覧覧覧覧", 18, 2 218 76 4, center
  text "覧覧覧覧覧覧覧", 19, 2 273 76 4, center
}

on *:DIALOG:aschar:dclick:*: { 
  if ($did == 3) { clipboard $gettok($did(3).seltext, 2, 32) }
  if ($did == 4) { clipboard $gettok($did(4).seltext, 2, 32) }
}

on *:DIALOG:aschar:sclick:*:{
  if ($did == 0) { halt }
  if ($did == 7) { did -ra aschar 8 $chr($did(6)) }
  if ($did == 13) { did -ra aschar 14 $asc($did(12)) }
  if ($did == 15) { dialog -x aschar aschar }
}

on *:DIALOG:aschar:init:0:{ getchars }

Alias getchars {
  var %chr1 32
  var %chr2 146
  while (%chr1 < 146) { 
    did -a aschar 3 %chr1 $+ : $chr(%chr1) 
    inc %chr1
  }
  while (%chr2 < 256) {
    did -a aschar 4 %chr2 $+ : $chr(%chr2)
    inc %chr2
  }
}
