Character map display with ASCII values (iPad /iPhone/iPod)

User avatar
Dav
Posts: 279
Joined: Tue Dec 30, 2014 5:12 pm
My devices: iPad Mini, iPod Touch.
Location: North Carolina, USA
Contact:

Character map display with ASCII values (iPad /iPhone/iPod)

Post by Dav »

I made this to help me see what characters are on my apple device. This utility will show many characters at a time, and clicking on the character will give you its ASCII value (to use with CHR$). If you then click on the displayed character at the bottom, it will send the CHR$ information to the clipboard.

- 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
Attachments
chrmap.jpg
chrmap.jpg (132.98 KiB) Viewed 5924 times
Last edited by Dav on Sun Jul 12, 2015 12:06 pm, edited 6 times in total.

User avatar
Dutchman
Posts: 851
Joined: Mon May 06, 2013 9:21 am
My devices: iMac, iPad Air, iPhone
Location: Netherlands
Flag: Netherlands

Re: Character map display with ASCII values (iPad version)

Post by Dutchman »

This is a very useful tool. :!:
Great 'simple' display
Thank you very much.

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Character map display with ASCII values (iPad version)

Post by Mr. Kibernetik »

Very nice program, but "click to send to clipboard" function does not work for me - it saves to clipboard incorrect code.

User avatar
Dav
Posts: 279
Joined: Tue Dec 30, 2014 5:12 pm
My devices: iPad Mini, iPod Touch.
Location: North Carolina, USA
Contact:

Re: Character map display with ASCII values (iPad version)

Post by Dav »

Mr. Kibernetik wrote:Very nice program, but "click to send to clipboard" function does not work for me - it saves to clipboard incorrect code.
Thanks. I corrected the code now, it should work correctly. I was playing with the code before posting it and must have not fixed it back. CHR value was 100 off. Now it is right. Thanks for catching that.

- Dav

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Character map display with ASCII values (iPad version)

Post by Mr. Kibernetik »

Ok. Maybe I am missing something, but still I cannot get right code into the clipboard...

User avatar
Dav
Posts: 279
Joined: Tue Dec 30, 2014 5:12 pm
My devices: iPad Mini, iPod Touch.
Location: North Carolina, USA
Contact:

Re: Character map display with ASCII values (iPad version)

Post by Dav »

You are right. I have changed the code again and tested better. I believe it is working this time.

- Dav

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Character map display with ASCII values (iPad version)

Post by Mr. Kibernetik »

Cool!

User avatar
Dav
Posts: 279
Joined: Tue Dec 30, 2014 5:12 pm
My devices: iPad Mini, iPod Touch.
Location: North Carolina, USA
Contact:

Re: Character map display with ASCII values (iPad /iPhone/iPod)

Post by Dav »

I have rewritten this utility program. It now should work in iPad & iPhone & iPod touch. A screenshot has been posted.

When copying to clipboard a notice is displayed saying it copied.

I don't have an iPhone to test on, so if someone who has one can post how it looks on an iPhone I would appreciate it. It displays well on my iPod touch.

- Dav

User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: Character map display with ASCII values (iPad /iPhone/iPod)

Post by rbytes »

Very handy app. Thanks, Dav. I was aware of the CHR$ function, but I thought the
allowable values were only from 0 to 255.
The only thing that gets me down is gravity...

Henko
Posts: 814
Joined: Tue Apr 09, 2013 12:23 pm
My devices: iPhone,iPad
Windows
Location: Groningen, Netherlands
Flag: Netherlands

Re: Character map display with ASCII values (iPad /iPhone/iPod)

Post by Henko »

Dav wrote:I have rewritten this utility program. It now should work in iPad & iPhone & iPod touch. A screenshot has been posted.

When copying to clipboard a notice is displayed saying it copied.

I don't have an iPhone to test on, so if someone who has one can post how it looks on an iPhone I would appreciate it. It displays well on my iPod touch.

- Dav
Works perfect on my iPhone5s.
Nice app! Thanks

Post Reply