home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rexxlb.zip / SAMPLES / ASCII.CMD < prev    next >
OS/2 REXX Batch file  |  1993-01-08  |  2KB  |  44 lines

  1. /*****************************************************************************/
  2. /*                                                                           */
  3. /* ASCII: display an ASCII chart                                             */
  4. /*                                                                           */
  5. /* Requires Personal REXX or REXXLIB (scrsize, scrwrite, scrput, cursor      */
  6. /* functions).                                                               */
  7. /*                                                                           */
  8. /*****************************************************************************/
  9.  
  10. line. = ''
  11.  
  12. call calcascii 0, 127, 0
  13. call calcascii 128, 255, 128
  14. horizontal = 'c4'x
  15. vertical = 'b3'x
  16.  
  17. parse value scrsize() with height width .
  18. call scrwrite 1, 1, '', height * width, ' ', 31     /* clear screen */
  19. call scrput 1, 1, "                                  Ascii Chart"
  20. call scrput 2, 1, "        0  10  20  30  40  50  60  70  80  90  A0  B0  C0  D0  E0  F0"
  21. call scrput 3, 1, "        0  16  32  48  64  80  96  112 128 144 160 176 192 208 224 240"
  22. call scrput 4, 1, "     " || 'da'x || copies('c4'x, 65) || 'bf'x
  23. buf = " "vertical
  24. do loop = 0 to 15
  25.   gloop = loop // 16
  26.   if loop = 10 then buf = vertical
  27.   call scrput loop + 5, 1, d2x(gloop) gloop buf line.loop||vertical||d2x(gloop) gloop
  28. end
  29. call scrput 21, 1, "     " || 'c0'x || copies('c4'x, 65) || 'd9'x
  30. call cursor 22, 1
  31.  
  32. exit
  33.  
  34. Calcascii:
  35. parse arg start, ending, breakoff
  36. do loop = start to ending
  37.   if loop < breakoff then chars = " .  "
  38.   else chars = " "||d2c(loop)||"  "
  39.   gloop = (loop // 16)
  40.   line.gloop = line.gloop || chars
  41. end
  42.  
  43. return
  44.