home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / articles / archives / limanews.exe / ASCII.TXT < prev    next >
Text File  |  2006-10-19  |  6KB  |  170 lines

  1. ORIGINALLY PUBLISHED IN LIMA NEWSLETTER NOVEMBER 1990
  2.  
  3.           All About Character Sets  
  4.           By:  Andy Frueh, Lima UG 
  5.  
  6.      I had written about using CTRL and FCTN keys as a form of "macro" since
  7. practicaly every CTRL keypress represents a keyword.  All of this got me
  8. thinking about the TI's character set, and a lot of the information pertaining
  9. to it.  What follows is a lot of miscellaneous data on the ASCII characters. 
  10.  
  11.      Most people don't take much interest in character sets.  You hit a key, a
  12. symbol shows up on the screen.  A code is assigned to every character.  These
  13. codes are numerical values from 0 to 255.  A space (or more appropriately
  14. called a blank) is code 32, a capital D is 68, etc.  The computer knows at
  15. least two things about each character.  Its graphic (what it looks like) and
  16. its assignment (what keys you press to get that character).  You can use both.
  17. For example, when you type in a program and use PRINT, DISPLAY, DISPLAY AT, or
  18. INPUT/LINPUT with a prompt, you are using the graphic representation.  When you
  19. use an HCHAR or VCHAR, you must use the actual numerical ASCII code.  You also
  20. do this with the CALLS KEY subprogram.  The function ASC and CHR$ also use
  21. numerical representations. 
  22.  
  23.      This information is all in the manual.  There is some data that is not in
  24. the manuals, or is covered in technical jargon. 
  25.  
  26.      When you use VCHAR, HCHAR, and CHR$, you can actually use values up to
  27. 32767.  256 is continually subtracted until you get a value in the 0-255 range.
  28. Not all codes have graphic representations.  These are usually "empty" and
  29. appear as the blank/space character. 
  30.  
  31. 0 - Undefined (no key assignment/graphic) 
  32.  
  33. 1 to 15 - Function keys (see chart 1).  Most of these can be accessed in
  34. programs using CALL KEY, but not as response to ACCEPT AT/INPUT statements.
  35. They have no graphic (unless a program gives it one.  In that case, typing the
  36. character gives the pattern it was assigned.) 
  37.  
  38. 16 to 29 - Undefined (these are the same as 0 since they don't have graphics or
  39. key assignments and there really isn't an easy way to give them either.) 
  40.  
  41. 30 - This is the cursor, usually a black square.  An assembly routine is
  42. usually needed to redefine its graphic. 
  43.  
  44. 31 - This is the screen border.  It is a blank and the color of the border
  45. around the screen, not the color of the screen itself.  It has no key
  46. assignment. 
  47.  
  48. 32 to 126 - The "standard" characters (see chart 2).  These are such things as
  49. letters, numbers, and symbols used in everyday typing.  They can be redefined
  50. in a program. 
  51.  
  52. 127 to 159 - These are called "user-defined" characters (see chart 3).  They
  53. originally have no graphic.  The manual is incorrect in that it says when a
  54. program ends, the characters blank out.  This is not true.  Also, these keys
  55. have key assignments and are used to represent BASIC keywords at first.  All
  56. but one requies you press CTRL and another key.  Character 127 used the FCTN
  57. key. 
  58.  
  59. 160 to 175 - Undefined (see above) 
  60.  
  61. 176 to 198 - These characters have key assignments (see chart 4), but no
  62. graphic, and no easy way to give any.  They can be used with CALL KEY, but can
  63. not be displayed. 
  64.  
  65. 199 to 255 - Undefined (see above) 
  66.  
  67.      Even those which I labeled as undefined have a use.  You can access them
  68. through CHR$ and ASC functions.  They are useful as markers when manipulating
  69. strings.  If you are transmitting data from the TI to another computer, the
  70. other computer may have representations for these characters. 
  71.  
  72.      Finally, each character string has a code between 0 and 255, accessable
  73. through CHR$ and ASC.  The SEG$ function will let you address individual
  74. characters in strings, and the apersand operator (SHIFT 7) called concatenation
  75. will allow you to compose a string out of individual characters.  If you have a
  76. program that keeps track of thousands of small integers and you can't fit them
  77. in available memory, strings are probably the answer. 
  78.  
  79. Chart 1 - Function Key Codes 
  80. CODE   KEY 
  81. 1      FCTN 7 (AID) 
  82. 2      Not useable in BASIC.  It is associated with FCTN 4, but you can't
  83.        really use this in BASIC.  In Extended BASIC, an ON BREAK will work. 
  84. 3      FCTN 1 (DELETE) 
  85. 4      FCTN 2 (INSERT) 
  86. 5      Used with QUIT.  In Extended BASIC, a CALL LOAD disables this key.  I am
  87.        not sure whether you can use FCTN = and a key code of 5 in a program. 
  88. 6      FCTN 8 (REDO) 
  89. 7      FCTN 3 (ERASE) 
  90. 8      FCTN S (left) 
  91. 9      FCTN D (right) 
  92. 10     FCTN X (down) 
  93. 11     FCTN E (up) 
  94. 12     FCTN 6 (PROCEED) 
  95. 13     ENTER 
  96. 14     FCTN 5 (BEGIN) 
  97. 15     FCTN 9 (BACK) 
  98.  
  99. Chart 2 - Standard ASCII Characters 
  100.      These are in the User's Guide, Extended BASIC manual, and both BASIC's
  101. Quick Reference Card.  Refer to these.  Note that character 127 shouldn't
  102. really be in this group.  Characters in this group include 32 to 126. 
  103.  
  104.  
  105. Chart 3 - User Defined Characters 
  106. CODE   KEY 
  107. 127    FCTN V 
  108. 128    CTRL , 
  109. 129    CTRL A 
  110. 130    CTRL B 
  111. 131    CTRL C 
  112. 132    CTRL D 
  113. 133    CTRL E 
  114. 134    CTRL F 
  115. 135    CTRL G 
  116. 136    CTRL H 
  117. 137    CTRL I 
  118. 138    CTRL J 
  119. 139    CTRL K 
  120. 140    CTRL L 
  121. 141    CTRL M 
  122. 142    CTRL N 
  123. 143    CTRL O 
  124. 144    CTRL P 
  125. 145    CTRL Q 
  126. 146    CTRL R 
  127. 147    CTRL S 
  128. 148    CTRL T 
  129. 149    CTRL U 
  130. 150    CTRL V 
  131. 151    CTRL W 
  132. 152    CTRL X 
  133. 153    CTRL Y 
  134. 154    CTRL Z 
  135. 155    CTRL . 
  136. 156    CTRL ; 
  137. 157    CTRL = 
  138. 158    CTRL 8 
  139. 159    CTRL 9 
  140.  
  141. Chart 4 - Key Assigned/No Graphic 
  142. These characters aren't discussed 
  143. much in TI documentation. 
  144. CODE   KEY 
  145. 176    CTRL 0 
  146. 177    CTRL 1 
  147. 178    CTRL 2 
  148. 179    CTRL 3 
  149. 180    CTRL 4 
  150. 181    CTRL 5 
  151. 182    CTRL 6 
  152. 183    CTRL 7 
  153. 184    FCTN , 
  154. 185    FCTN . 
  155. 186    FCTN / 
  156. 187    CTRL / 
  157. 188    FCTN 0 
  158. 189    FCTN ; 
  159. 190    FCTN B 
  160. 191    FCTN H 
  161. 192    FCTN J 
  162. 193    FCTN K 
  163. 194    FCTN L 
  164. 195    FCTN M 
  165. 196    FCTN N 
  166. 197    FCTN Q 
  167. 198    FCTN Y 
  168. .PL 1 
  169.  
  170.