- Dav
Edit: v1.1 - Now works on iPad,iPhone and iPod touch
Code: Select all
'chrmap.txt v1.1 (iPad,iPhone,iTouch)
'Displays character map and ASCII values.
'You can set base ASCII value to use.
'Touch a character to get the ASCII value.
'After that, touch it below to send to clipboard.
'Coded by Dav, JULY/2015
'WORKS ON IPAD,IPHONE & IPOD TOUCH
if lowstr$(device_type$())="ipad" then
  dev=1
  num=100
  set buttons font size 56
  draw font size 24
else
  dev=0
  num=49
  set buttons font size 36
  draw font size 16
end if
set buttons custom
set orientation portrait
graphics
draw color 0,0,0
fill color 1,1,1
baseascii=9700  'default base CHR$ value to use
'=====
pageit:
'=====
btnbase=0
button "chr" delete
graphics clear 1,1,1
b$="Displaying CHR$ "&str$(baseascii)&" to "&str$(baseascii+num)
if dev=1 then
   draw text b$ at 200,20
else
  draw text b$ at 20,15
end if
if dev=1 then
  for x = 1 to 10
   for y = 1 to 10
     button btnbase text chr$(baseascii) at x*65,y*65 size 60,60
     btnbase = btnbase+1
     baseascii=baseascii+1
   next y
  next x
else
  for x = 0 to 6
   for y = 1 to 7
     button btnbase text chr$(baseascii) at x*45+5,y*45 size 40,40
     btnbase = btnbase+1
     baseascii=baseascii+1
   next y
  next x
end if
t$="(touch for ASCII value)"
if dev=1 then
  button "+100" text "Next 100" at 425,875
  button "-100" text "Back 100" at 75,875
  button "base" text "Set #..." at 500,750
  draw text t$ at 50,775
else
  button "+100" text "Next" at 215,460
  button "-100" text "Back" at 10,460
  button "base" text "Set#" at 215,365
  draw text t$ at 50,430
end if
do
  if button_pressed("+100") then goto pageit
  if button_pressed("-100") and baseascii > num then
     baseascii=baseascii-(num*2)
     goto pageit
  end if
  if button_pressed("base") then
    INPUT "Enter base ASCII value (number)":baseascii
    graphics
    if baseascii <0 then baseascii =0
    graphics clear 1,1,1
    goto pageit
  end if
  for c=0 to num-1
    if button_pressed(str$(c)) then
      graphics clear 1,1,1
      copycode$="CHR$("&str$(baseascii-num+c)&")"
      s$="is CHR$("&str$(baseascii-num+c)&")"
      if dev=1 then
        button "chr" text chr$(baseascii-num+c) at 100,750 size 65,65
        draw text s$ at 190,770
        draw text "click to send to clipboard" at 100,825
      else
        button "chr" text chr$(baseascii-num+c) at 15,380 size 40,40
        draw text s$ at 60,390
        draw text "click to send to clipboard" at 30,430
      end if
    end if
  next c
  if button_pressed("chr") then
     clipboard clear
     clipboard write copycode$
     graphics clear 1,1,1
     if dev=1 then
       draw text "Sent to Clipboard!" at 197,770
     else
       k$=copycode$&" sent to clipboard"
       draw text "Copied!" at 80,390
       draw text k$ at 25,430
     end if
  end if
until 0


