Show ASCII table

From Rosetta Code
Revision as of 04:18, 9 August 2018 by CalmoSoft (talk | contribs) (Created page with "{{draft task}} [https://1drv.ms/u/s!AqDUIunCqVnIg1qxikt4iQQqKMEp Show Ascii table] from value 32 to 127 in table format. =={{header|Ring}}== {{draft task}} <lang ring> # Proje...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Show ASCII table is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.

Show Ascii table from value 32 to 127 in table format.

Ring

Show ASCII table is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.

<lang ring>

  1. Project : Show Ascii table

load "guilib.ring" load "stdlib.ring"

paint = null decarr = newlist(16,6) ascarr = newlist(16,6)

new qapp

       {
       win1 = new qwidget() {
                 setwindowtitle("Show Ascii table")
                 setgeometry(100,100,800,600)
                 label1 = new qlabel(win1) {
                             setgeometry(10,10,800,600)
                             settext("")
                 }
                 for n = 1 to 16
                      for m = 1 to 6
                           decarr[n][m] = new qpushbutton(win1) {
                                                 x = 150+m*60
                                                 y = 30 + n*30
                                                 setgeometry(x,y,30,30)
                                                 settext(string((m-1)*16+n+31))
                                                 }
                      next
                 next
                 for n = 1 to 16
                      for m = 1 to 6
                           ascarr[n][m] = new qpushbutton(win1) {
                                                 x = 180+m*60
                                                 y = 30 + n*30
                                                 ind = (m-1)*16+n+31
                                                 setgeometry(x,y,30,30)
                                                 if ind = 32
                                                    settext("Spc")
                                                    loop
                                                 ok
                                                 if ind = 127
                                                    settext("Del")
                                                    loop
                                                 ok
                                                 settext(char(ind))
                                                 }
                      next
                 next
                 show()
       }
       exec()
       }

</lang> Output:

Show Ascii table