home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / OL.LZH / PROCS.LZH / ASCIINAM.ICN < prev    next >
Text File  |  1991-07-13  |  779b  |  29 lines

  1. ############################################################################
  2. #
  3. #    Name:    asciiname (asciinam.icn)
  4. #
  5. #    Title:    ASCII "name" of unprintable character.
  6. #
  7. #    Author:    Robert J. Alexander
  8. #
  9. #    Date:    September 7, 1990
  10. #
  11. ############################################################################
  12. #
  13. #  asciiname -- Procedure to return mnemonic name of ascii non-printable
  14. #  characters.
  15. #
  16.  
  17. procedure asciiname(s)
  18.    local o
  19.    static names
  20.    initial {
  21.       names := ["NUL","SOH","STX","ETX","EOT","ENQ","ACK","BEL",
  22.         "BS" ,"HT" ,"NL" ,"VT" ,"NP" ,"CR" ,"SO" ,"SI" ,
  23.         "DLE","DC1","DC2","DC3","DC4","NAK","SYN","ETB",
  24.         "CAN","EM" ,"SUB","ESC","FS" ,"GS" ,"RS" ,"US" ]
  25.       }
  26.    o := ord(s)
  27.    return names[o + 1] | (if o = 127 then "DEL")
  28. end
  29.