home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / EDUCATIN / TTYPE3.LBR / TTYPE.DQC / TTYPE.DOC
Text File  |  2000-06-30  |  19KB  |  600 lines

  1.                        TOUCHTYPE TUTOR
  2.                  Version 2.0  16th April 1982
  3.                    Direct Cursor Addressing
  4.  
  5.  
  6.  
  7.  
  8.             Concept By: Tim Pearce   7 Bannerman St,
  9.                                      Cremorne, N.S.W.
  10.    
  11.            Reworked By: R. Berthet   15/5 Cottonwood Cr.
  12.                                      North Ryde, 2113.
  13.                                      SYDNEY.
  14.                                      (61-2)-88-1640
  15.  
  16.  
  17.  This  document  is  entered into the public  domain  by  its 
  18.   author, Richard Berthet. Please do not remove this notice.
  19.  
  20.  
  21. INTRODUCTION
  22.  
  23. TTYPE  (TOUCHTYPE TUTOR) is an application programme  designed 
  24. to  aid the user to quickly gain touch typing skills using the 
  25. computer keyboard and the computer, of course.
  26.  
  27.  
  28.  
  29. Some of the features are:
  30.  
  31. *    Lots of HELP, which you can expand.
  32.  
  33. *    Onscreen  representation of a 'QWERTY' keyboard  to  give           
  34.      visual feedback.
  35.  
  36. *    Graduated    exercises   with   prompts   (or   comments) 
  37.      throughout.
  38.  
  39.  
  40. The  objective  of  this  document  is  to  assist  you,   the 
  41. programmer to get the programme up and running on your  system 
  42. as fast as possible,  whereupon,  it is fairly obvious what it 
  43. is supposed to do and how it is supposed to do it.
  44.  
  45. For the impatient, I propose to first discuss what to alter to 
  46. make  it  go  straightaway,   and for those who  may  wish  to 
  47. tinker,  I  will  launch into a discourse about the  programme 
  48. itself .
  49.  
  50.                       QUICK INSTALLATION 
  51.  
  52.  
  53. Hardware  
  54.  
  55. This  version,  (2.0),  of TTYPE is written for Direct  Cursor 
  56. Addressing terminals,  so if yours isn't,  then you may either 
  57. do  a complete rewrite or wait for the  Non-Cursor  Addressing 
  58. version.
  59.  
  60. Software
  61.  
  62. Following  is  a  list of FILES that must accompany  the  main 
  63. programme. It is necessary to have SOME exercise files, A to J 
  64. are presently included.
  65.  
  66.  
  67. TTYPE   .BAS             MBASIC Source Code 
  68.  
  69. TTKEYBD .DAT             KEYBOARD Datafile
  70. TTHELP0 .DAT             HELP File 0
  71. TTHELP1 .DAT             HELP file 1                   
  72. TTHELP2 .DAT             HELP file 2                   
  73. TTHELP3 .DAT             HELP file 3                   
  74. TTHELP4 .DAT             HELP file 4                   
  75. TTHELP5 .DAT             HELP file 5                   
  76.  
  77. TTYPEXA .DAT             |
  78.  through to              | Present EXERCISE Datafiles
  79. TTYPEXJ .DAT             |
  80.  
  81. Before running,  the software will need to be altered to  suit 
  82. your terminal and computer. Here is a list of changes that may 
  83. need to be made to get you on the road:
  84.  
  85.  
  86. 1.   Refer to SECTION 1: 'ASCII CONTROL CODES' of Main Program
  87.  
  88. In  this  section you will find the function to DEFine  direct 
  89. cursor addressing-
  90.  
  91. ?????     DEF FNCSRLD$(ROW,COLUMN) =
  92.                         ESC$+"="+CHR$(ROW+31)+CHR$(COLUMN+31)
  93.  
  94.  
  95. The constant '31' is the offset to correct the argument of the 
  96. function  from absolute ASCII values to ROW and COLUMN numbers 
  97. for a 24 line X 80 column screen. If yours is different insert 
  98. the  correct constant.  (A visual result of the  function  not 
  99. having  the  proper values as its argument will  be  "haywire" 
  100. printing on-screen.)
  101.  
  102. 2.   Refer to SECTION 3: 'INITIALISING BLOCK' of Main Program.
  103.  
  104. You may need to change the following constants-
  105.  
  106. DATAPORT%   = 0            Decimal address of system dataport.
  107.  
  108. STATUSPORT% = DATAPORT%+1  Decimal  address   of   system 
  109.                            status port. 
  110.  
  111. ESCTYPE%    = 127          ASCII  value of character  used  to 
  112.                            escape    to   command   level   of 
  113.                            programme.
  114.  
  115. ESCCHAR$  = "RUB"          String to print name of key for the 
  116.                            above character (ESCTYPE%).
  117.  
  118.  
  119. Those few changes should at least make it look like it's going 
  120. to  run,  if  not you'll have to read the full description  to 
  121. ascertain where your problem is.
  122.  
  123.                     EXPLANATION OF THE FILES
  124.  
  125. TTYPE.BAS
  126.  
  127. TTYPE.BAS  is the MBASIC source code which contains  the  body 
  128. of the programme and its assorted subroutines. This is the one 
  129. that you will have to alter to suit your system.  (See  either 
  130. Quick Installation or Programme Guide.)
  131.  
  132.  
  133. TTKEYBD.DAT
  134.  
  135. TTKEYBD.DAT    contains    the   data   for   the     onscreen 
  136. representation  of your terminals KEYBOARD.  It will  probably 
  137. require  alteration  of  some of the minor  keys  that  always 
  138. differ  between  terminals.  You will need the aid of  a  text 
  139. editor(i).  Following  is  what  the file looks  like  and  an 
  140. explanation of its format-
  141.  
  142.  
  143. 13,1,2,3,4,5,6,7,8,9,0,-,^,\
  144. !,,#,$,%,&,',(,),_,=,~,|
  145. 13,Q,W,E,R,T,Y,U,I,O,P,{,}," "
  146. q,w,e,r,t,y,u,i,o,p,[,]," "
  147. 12,A,S,D,F,G,H,J,K,L,+,*,`
  148. a,s,d,f,g,h,j,k,l,;,":",@
  149. 10,Z,X,C,V,B,N,M,<,>,?
  150. z,x,c,v,b,n,m,",",.,/
  151. 1," "," "
  152.  
  153.  
  154. Notice  that some of the characters are between double  quotes 
  155. (e.g.",")   this  is  because  MBASIC  interprets  the   comma 
  156. character  as  a separator of the data.  If you forget to  put 
  157. certain characters between quotes the READ statement gets "out 
  158. of step" and will eventually generate an error message.  (Read 
  159. the  MBASIC  manual  about the READ statement if you  are  not 
  160. sure.)  
  161.  
  162.  
  163. (i)  Avoid use of the WORDSTAR (R) word processor in  document 
  164. mode  on  DATAFILES.   It  has  the  nasty  habit  of  putting 
  165. 'invisible'  control characters in where you don't want  them, 
  166. for  its own nefarious purposes.  The net effect is that these 
  167. control characters send the programme berserk!  (Bit 8 of  the 
  168. Carriage Return is set high.)
  169.  
  170. KEYBOARD DATAFILE FORMAT
  171.  
  172. n,D,D,D,D,D,D,D,D
  173. N,N,N,N,N,N,N,N
  174.  
  175. WHERE:
  176.  
  177.      n       =         Number of keys in the row.
  178.  
  179.      D       =         Characters    DISPLAYED   as    the 
  180.                        keyboard.  (There  should be 'n' of 
  181.                        these.)
  182.  
  183.      N       =         NON-DISPLAY characters that corres-
  184.                        pond  to  DISPLAY  characters  when 
  185.                        shifted.
  186.                        i.e. You may choose to DISPLAY 
  187.                        upper-case   and  shift  to  lower-
  188.                        case,which  will therefore  be  the 
  189.                        NON-DISPLAY characters.
  190.  
  191.  
  192. TTYPEX? .DAT
  193.  
  194. Files of the genre TTYPEX? .DAT contain exercises and COMMENTs 
  195. and   are   called  by  the  main  programme  when   required. 
  196. (TTYPEXn.DAT where 'n' is a  letter)
  197.  
  198. *    Any single exercise line can be entered. 
  199.  
  200. *    Any line to be repeated is preceded by  '|n' where 'n' is                
  201.      the number of repeats.
  202.  
  203. *    A  COMMENT is preceded by '!#' and there may be up to  80                
  204.      characters per line.  For the COMMENT to print  correctly           
  205.      there must 5 lines of COMMENT, even if you only want one.
  206.      (See example following.)
  207.  
  208. *    A  PARAGRAPH is specified by '|pn,ll' on a line by itself 
  209.      where   'p'   indicates  to  the  program   this   is   a 
  210.      PARAGRAPH;'n'  is  the number of times to repeat  it  and 
  211.      'll' is a 2 digit specification of the number of lines in 
  212.      the PARAGRAPH.
  213.  
  214.  
  215. EXAMPLE OF EXERCISE DATAFILE
  216.  
  217.  
  218. !#Exercise A. 
  219. !#    
  220. !#        Left hand on the [A] [S] [D] [F] keys.
  221. !#
  222. !#        Right hand on the [J] [K] [L] [;] keys.
  223. |3fff fff jjj jjj fff jjj ff jj ff jj f j
  224. |3ddd ddd kkk kkk ddd kkk dd kk dd kk d k
  225. !#
  226. !#
  227. !#        RETURN the carriage without looking up.
  228. !#
  229. !#
  230. |3sss sss lll lll sss lll ss ll ss ll s l
  231. |3aaa aaa ;;; ;;; aaa ;;; aa ;; aa ;; a ;
  232. |2aaa ddd add add aaa lll all all add all
  233. |3aaa sss kkk ask jjj aaa lll jal ask jal
  234. |3ddd aaa aaa dad lll aaa ddd lad dad lad
  235. |3a as ask asks asks; f fa fal fall falls
  236. |3a al ala alas alas; f fl fla flas flask
  237. |3a ad add adds adds; s sa sal sala salad
  238. !#
  239. !#
  240. !#        GOAL: Finish next two lines in one minute.
  241. !#
  242. !#
  243. |2a sad fad; a lass falls; dad asks a lad;
  244.  
  245.  
  246. TTHELP? .DAT
  247.  
  248. Again  these are a family of files and contain the  HELP  text 
  249. (TTHELPn .DAT where 'n' is  a number, presently in the range 0 
  250. to  5).  They  are designed with one special character (#)  in 
  251. them  which,  when read by the programme halts  further  input 
  252. until  receipt of a carriage return (See SECTION 8  Subroutine 
  253. [4] for full explanation).
  254.  
  255. This is TTHELP5 .DAT -
  256.  
  257.  
  258.     <RETURN> - Continues  with next line in the exercise.    
  259.  
  260.  
  261.  
  262.     M - You've found this one!
  263.  
  264.  
  265.     
  266.     E - End the running of this program.
  267.  
  268.  
  269.  
  270.     Q - Quit to operating system.
  271.  
  272.     
  273.  
  274.     
  275.  
  276. Hit <RETURN> for more HELP.
  277. #
  278.  
  279.  
  280.     N - Start a NEW exercise.
  281.  
  282.  
  283.     R - REPEAT last line, when you can't get it right!
  284.  
  285.  
  286.     S - SKIP lines in this exercise.  You will be prompted for 
  287.         the  number  of  lines  to  SKIP.  Note  that  printed 
  288.         comments have already been skipped.
  289.  
  290.  
  291.     W - Print the number of WORDS so far and the ERROR  count.    
  292.         Then the RESET option resets the ERROR COUNT to zero.
  293.  
  294.     
  295.     L - Print  the  number  of  LINES read  from  the  current 
  296.         exercise  file.  Used  in  combination with  <S>  this 
  297.         command  tells  you roughly how many lines to Skip  to 
  298.         restart in the middle of an exercise.
  299.  
  300. HIT key for MENU selection. 
  301.  
  302.                        PROGRAMME GUIDE
  303.  
  304.  
  305. You've  heard of the Hitch Hiker's Guide to the  Galaxy,  well 
  306. this is the Programmer's Guide to Touch Typing. The Plot is to 
  307. take you section by boring section through the main programme. 
  308. Do not adjust your seat. We are in complete control. STANDBY !
  309.  
  310. (Oh,  by  the way,  the programme listing is liberally  dotted 
  311. with remarks, so these notes are a companion to them.)
  312.  
  313.  
  314. SECTION 1  TERMINAL ATTRIBUTES
  315.  
  316. Contained herein are all the onscreen pretty bits,  originally 
  317. from a larger MBASIC utility called UTILSCRN.BAS,  written for 
  318. the   Lear Seigler ADM-31 terminal.  The remarks tell  all  (I 
  319. hope !).
  320.  
  321. Things to look out for:
  322.      
  323.      *  Check the ESCAPE sequences for your terminal and alter 
  324.         them to suit it.
  325.  
  326.      *  As mentioned earlier, FNCSRLD$(ROW,COLUMN) is the fun-
  327.         ction  defining  direct cursor  addressing,  you  will 
  328.         probably have to change the offset for the origin.
  329.  
  330.      *  The string variables WRTPRTON$ and WRTPRTOFF$ are used 
  331.         to  switch the video between full and half  amplitude. 
  332.         If  your  terminal has an equivalent function use  it, 
  333.         it'll make it prettier. 
  334.  
  335.  
  336.  
  337. SECTION 2  ALTERATIONS LOG
  338.  
  339. Just  a little bit of info to keep track of  the   programme's 
  340. metamorphosis.
  341.  
  342.  
  343.  
  344. SECTION 3  INITIALISING BLOCK
  345.  
  346. Ahhhhh  now we come to an important bit.  In amongst this  lot 
  347. the  numeric  and  string  constants  are  assigned  to  their 
  348. appropriate variables.
  349.  
  350. Things to look out for:
  351.  
  352.      *  DATAPORT% will probably be different in your machine. 
  353.  
  354.      *  ESCTYPE%  sets  the ASCII value of a key to strike  to 
  355.         enter  COMMAND mode.  I chose a key which is not  used 
  356.         often and was readily available.
  357.  
  358.      *  ESCCHR$ assigns a string to print the name of the  key 
  359.         you have chosen.  (In my case it was "RUB".)
  360.  
  361.      *  DELAY% sets the length of a time delay. The use of the 
  362.         time  delay  is explained in the section dealing  with 
  363.         Subroutines.  As  a  guide I've used 25  when  running 
  364.         under  the  interpreter and  500  when  compiled.  The 
  365.         system  has a 6MHz clock.  (Don't forget to change  it 
  366.         when  compiling,  as I always do,  forget that is;  or 
  367.         some text will be just a figtree of your imagination.)
  368.  
  369.      *  Next  you'll  find a sub-headins  "SCREEN  ADDRESSES". 
  370.         These   and   their  associated   remarks   are   self 
  371.         explanatory.  You can fiddle with these to your hearts 
  372.         content  if  you  want to achieve a  different  screen 
  373.         layout.
  374.  
  375.  
  376.      
  377. SECTION 4  START OF ACTIVE CODE & INPUT MENU
  378.  
  379. This is the first bit of code that actually does something on-
  380. screen.  Essentially, it presents menu questions to initialise 
  381. flags  and will print HELP if it is requested.  It  is  broken 
  382. into  4  sub-sections  which  are the  4  questions  that  the 
  383. programme seeks answers to.
  384.  
  385. SECTION 5  SET UP & CHECK EXERCISE FILE 
  386.  
  387. My  first reaction upon reading this code was unprintable;  it 
  388. still is.  I haven't done much to it,  apart from annotations, 
  389. because  the flow is so tortuous that any changes cause it  to 
  390. bomb. Anyway, it works, even if it is messy !
  391.  
  392. The aim is to open the exercise file and perform the following 
  393. checks to each line as it is input:
  394.  
  395.  
  396.      * If End Of File (EOF),  then go to menu.
  397.  
  398.      * If it is an EXERCISE, how many repeats ?
  399.  
  400.      * If it is a COMMENT, then go to COMMENT processor.
  401.  
  402.      * If  it is a PARAGRAPH,  then input additional lines  of 
  403.        the paragraph.
  404.  
  405. The  programme  loops back through this section at the end  of 
  406. each  exercise,  starting  below the line where  the  file  is 
  407. opened.
  408.  
  409. SECTION 6  KEYBOARD SCAN
  410.  
  411. You'll  notice that this is one large FOR  NEXT loop which  is 
  412. controlled  by  the  number of letters  in  each  exercise.  A 
  413. summary of the functions performed:
  414.  
  415.      *  Assign,  from  previously stored array,  an address of 
  416.         the  exercise  character,   that  corresponds  to  its 
  417.         position on the onscreen keyboard.
  418.  
  419.      *  Print and highlight the exercise character on the key-
  420.         board.
  421.  
  422.      *  Wait  until  response to exercise character  is  typed 
  423.         from terminal keyboard.
  424.  
  425.      *  Print resultant input on ECHOROW or store it until end 
  426.         of exercise if ECHO OPTION is off.
  427.  
  428.      *  Check   for  ESCAPE  character  or  RETURN  and   take 
  429.         appropriate action.
  430.  
  431.      *  Check  input  character to see if  it  corresponds  to 
  432.         exercise  character,  if not increment ERRORCOUNT  and 
  433.         CHARCOUNT.
  434.  
  435. That is basically what occurs, minus a few embellishments.
  436.  
  437.  
  438. SECTION 7  ESCAPE OR ALTER PROGRAMME FLOW
  439.  
  440. A  series  of IF THEN statements sort out suitable  action  in 
  441. response to the character input by the user,  after he/she has 
  442. read the MENU. If no match is made the MENU is presented again 
  443. until a match is made.
  444.  
  445. SECTION 8 SUBROUTINES
  446.  
  447. The subroutines are numbered; 1 to 9. I shall briefly describe 
  448. the essence what each does:
  449.  
  450.  
  451.      1. CAPITAL.
  452.  
  453.      If the character falls within the range of the lower case 
  454.      alphabet it is converted to upper case.
  455.  
  456.  
  457.      2. ERROR COUNT.
  458.  
  459.      Prints the number of errors in the number of words  typed 
  460.      so far.
  461.  
  462.      3. INSTRUCTION LINE ADDRESS.
  463.  
  464.      Adjusts the address for instructions to be printed on the 
  465.      screen  after the last instruction was printed.  Not used 
  466.      in this version.
  467.  
  468.  
  469.      4. PRINT HELP.
  470.  
  471.      * Clears screen.
  472.  
  473.      * Opens  TTHELP?  .DAT,  which  is  checked  for  end  of 
  474.        file(EOF). 
  475.  
  476.      * If  (EOF)  the program waits for any  character  to  be 
  477.        input,  on  character  input the file  is  closed,  the 
  478.        screen cleared and a return made to the main programme.
  479.  
  480.      * If  it is'nt (EOF) a line is input from the  file,  the 
  481.        left-most  character is checked for the page de-limiter 
  482.        (#).
  483.  
  484.      * If "#" is present the programme waits for a <CR> input, 
  485.        whereupon  the  screen is cleared and flow  returns  to 
  486.        check for end of file etc.
  487.  
  488.      * Otherwise  the  line is printed and  flow  returned  to 
  489.        check for end of line etc.
  490.  
  491.  
  492.      5. PRINT KEYBOARD.
  493.  
  494.      The objective is to print on the screen, a representation 
  495.      of the terminals' keyboard.  The method may not appear to 
  496.      be too clear, but I shall  attempt a description;
  497.  
  498.      * The file TTKYBD.DAT is opened. 
  499.  
  500.      * The  array,  ADDRESS%(X,Y) has its contents initialised 
  501.        to 1. 
  502.  
  503.      * The  loop  JLOOP%  cycles through the 5  lines  in  the 
  504.        keyboard  data that contain the NUMber OF KEYS  in  the 
  505.        upper and lower case rows. 
  506.  
  507.      * The  loop(s) ILOOP% cycle through unshifted  characters 
  508.        and  then  the shifted characters.  The first ILOOP  is 
  509.        essentially  th same as the second.  Inside this  first 
  510.        loop the programme reads a character converts it to  an 
  511.        integer and assigns it to an array.  The ROW and COLUMN 
  512.        addresses  are stored in ADDDRESS%(X,Y).  The character 
  513.        is  printed  at  its correct  position  and  an  intger 
  514.        representation   is  also  stored  in  DISPLAYCHAR%(X). 
  515.        COLUMN%  is  incremented by 4 or whatever  spacing  you 
  516.        wish.  Inside  the second ILOOP the same occurs  except 
  517.        with one  difference;
  518.  
  519.  
  520.      The  programme tests for  certain ILOOP and JLOOP  values 
  521.      that should correspond to the position on the keyboard of 
  522.      the double quote character (").  This character cannot be 
  523.      put  in  a BASIC data statement.  It is assigned  to  the 
  524.      array by CHR$(34).
  525.  
  526.  
  527.      6.SKIP LINES.
  528.  
  529.      * The  number of exercise lines to skip is input and  the 
  530.        loop inputs the required number from the  exercise file 
  531.        and end of file is tested for in each pass.
  532.  
  533.  
  534.      7. COMMENT PRINT.
  535.    
  536.      When the COMMENT indicators are detected in the  exercise 
  537.      file the programme branches to here. The next 4 lines are 
  538.      input from the file and stored in COMMENT$(X),  these are 
  539.      then printed in the next loop.
  540.  
  541.  
  542.      8. TIME DELAY.
  543.  
  544.      The two loops just give a predetermined time delay. I now 
  545.      have  a  more  sophisticated version that will  give  the 
  546.      number of seconds delay that you input to the subroutine, 
  547.      to be addded at a later date.
  548.  
  549.  
  550.      9. PRINT HELP MENU.
  551.  
  552.      Prints a basic help for the input MENU.
  553.  
  554.       
  555. SECTION 9  ERROR TRAPPING
  556.  
  557.  
  558. These few lines are the minimum of error trapping,  a lot more 
  559. could be done.
  560.  
  561. If  the programme is on the "A" drive and can't find  a  file, 
  562. the  file  is  closed and "B:" appended to  the  filename  and 
  563. another attempt is made to open the file.  If it is not on the 
  564. B  drive  forget it !.  If the programme is on the B drive  it 
  565. does  not look for files on the A drive if they aren't on  the 
  566. B.
  567.  
  568.  
  569.                            THE END
  570.  
  571.  
  572.  
  573.  
  574.  
  575. HINTS, HELP AND APOLOGIES
  576.  
  577.  
  578. Well  that's a load of(sic) my mind.  Don't think that  you'll 
  579. turn into an ace typist overnight, I typed this blurb in using 
  580. the "Three Finger Technique".
  581.  
  582. Brickbats  and  boquets  may  be  addressed  to  the   author, 
  583. (preferably enclosed with $50 notes). 
  584.  
  585. My sincerest apologies for any errors in the document,  but as 
  586. we all know documenting a programme is the PITS!!!!.
  587.  
  588.  
  589. Now an idea from the programme originator, Mr Tim Pearce;
  590.  
  591. It  would  be easy to interface a real time clock  to  measure 
  592. typing  speed.  (e.g.  using a Godbout SYSTEM SUPPORT 1  BOARD 
  593. with a real time clock etc etc.)
  594.  
  595. Just a little something for you to work on...................
  596. ............................HAPPY TYPING
  597.  
  598.  
  599.                                         Richard Berthet.
  600.