home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / uploads / mouse-ex.lbr / HELP.MZE / HELP.MSE
Encoding:
Text File  |  1993-06-07  |  5.6 KB  |  168 lines

  1.  
  2. ~ HELP.MSE, Lee Bradley, 17 March 1990
  3. ~ Updated on 6 July 1990 - Removed main loop; program now reloads via &
  4. ~ feature. Also, added information on &-delimited filename.
  5.  
  6. 'D K :   ~ Use 24 line feed clear screen, for starters
  7.  
  8. #Z;      ~ "Clear" the screen
  9.  
  10. ~ Display screen configuration panel and get user input
  11.  
  12. "!!                  
  13.                                HELP.MSE "
  14.  
  15. "!
  16.       To clear the screen, I need to know what terminal you are using.
  17.  
  18.                      Press R for Royal, K for Kaypro,
  19.           X for Xerox, or anything else for a 24 line feed default.
  20.  
  21. !!!!!!"        ~ throw in a few blank lines here, for looks
  22.  
  23. "                              (R,K,X) ? " ?' K :
  24.  
  25. ~ Present four or so panels, ask if wanted again at end. Quit when
  26. ~ user presses N at final question
  27.  
  28. #Z;   ~ Clear (or scroll) the screen
  29.  
  30. "
  31. <blank>   No action.
  32.  
  33. "'$!'"    [Program terminator] Exit.  Also used to define Macros.
  34.  
  35. <number>  Push the value of <number> onto Stack.
  36.  
  37.                  Arithmetic operators +, -, *, /, \ .
  38.  
  39. +    [Add] Pop two operands from Stack and push their sum.
  40. -    [Subtract] Pop two operands from Stack and push their difference.
  41. *    [Multiply] Pop two operands from Stack and push their product.
  42. /    [Divide] Pop two operands from Stack and push their quotient.
  43. \    [Remainder] Pop two operands from Stack and push the remainder
  44.           obtained when the first is divided by the second.
  45.  
  46.                             I/O  commands.
  47.  
  48. ?    [Input number] Read a number from the keyboard and push its value
  49.         onto Stack.
  50. ?'   [Input character] Read a character from the keyboard and push
  51.         the value of its Ascii code onto Stack.
  52. "
  53.  
  54. ?' #Z;
  55.  
  56. "
  57.                        I/O  commands (continued).
  58.  
  59. "'!!'"    [Output number] Pop an operand from Stack and display its
  60.            value.
  61. "'!!'''!'"   [Output character] Pop an operand from Stack and display the
  62.            corresponding Ascii character.
  63. "''!'"<char>   [Character literal] Push the Ascii code for the graphic
  64.              character <char> onto Stack.
  65. "34!'"    [Output string] Display each character between the double quote
  66.            and the next double quote.  Translate exclamation points to 
  67.            <new-line>s.
  68.  
  69.                              Variables.
  70.  
  71. <letter> [Variable] Convert the letter to an integer in the range
  72.             0..25 (A = a = 0, B = b = 1, ..., Z = z = 25).  Add this
  73.             value, which is an address in Data, to OffSet and push the
  74.             result onto Stack.
  75. "
  76. ?' #Z;
  77.  
  78. "
  79.               Assigning data to variables with the colon.
  80.  
  81. :    [Assignment] Pop two operands from Stack and store the value
  82.        of the second at the address in Data specified by the value
  83.        of the first.
  84.  
  85.              Extracting values of variables with the period.
  86.  
  87. .    [Dereference] Pop an operand from Stack and push the 
  88.        value in Data of which it is the address.
  89.  
  90.             Making code conditional with  <, =,  and >.
  91.  
  92. <   [Comparison] Pop two operands from Stack.  If the first is
  93.        less than the second, push 1, else push 0 onto Stack.
  94. =   [Comparison] Pop two operands from Stack.  If they are
  95.        equal, push 1, else push 0 onto Stack.
  96. >   [Comparison] Pop two operands from Stack.  If the first is
  97.        greater than the second, push 1, else push 0 onto Stack.
  98. "
  99. ?' #Z;
  100.  
  101. "
  102.               Blocking off conditional code with [ and ].
  103.  
  104. [   [Conditional] Pop a value from Stack.  If it is zero or neg-
  105.        ative, skip over characters until a matching ] is encountered.
  106. ]   No action.
  107.  
  108.                       Loops use (, ), and ^ .
  109.  
  110. (   [Start loop]  Push CharPos onto EnvStack.
  111. )   [Go back to top of loop] Set CharPos from the top frame
  112.        of EnvStack without popping EnvStack.
  113. ^   [Exit loop] Pop an operand from Stack.  If it is zero or
  114.        negative, pop EnvStack, thereby resetting CharPos, and
  115.        skip to the matching ).
  116. "
  117. ?' #Z;
  118.  
  119. "
  120.               Macros use #<letter>, @, %, comma and ;.
  121.  
  122. #<letter> [Macro call] Push tag = macro, CharPos, and OffSet onto
  123.        EnvStack; set OffSet := NxtFree and NxtFree := NxtFree + 26;
  124.        and set CharPos to the first character following $<letter>.
  125. @   [Exit from macro]  Pop EnvStack, thereby resetting CharPos
  126.        and OffSet to their values before the macro call;  skip to
  127.        the ; that matches the # of the call;  and set NxtFree :=
  128.        NxtFree-26.
  129. %   [Replace formal parameter by actual] Push tag=parameter,
  130.        CharPos, and OffSet onto EnvStack;  locate the calling
  131.        environment for the macro in EnvStack and set CharPos and
  132.        OffSet from it; pop a value from Stack and use it to count
  133.        parameters in the calling environment (parameter n follows
  134.        the nth comma).
  135. ,   [End of actual parameter] Pop EnvStack, thereby resetting
  136.         CharPos and OffSet.
  137. ;   [End of actual parameter] Pop EnvStack, thereby resetting
  138.         CharPos and OffSet.
  139. "
  140. ?' #Z;
  141.  
  142. "
  143.                   Tracing is controlled by { and }.
  144.  
  145. {   Switch on tracing 
  146. }   Switch off tracing
  147.  
  148.          Invoking Mouse programs with &-delimited filename.
  149.  
  150. &filename& will cause filename.MSE to load and run. With this feature, you 
  151. may link several Mouse programs together.
  152.  
  153. "
  154. ?' #Z;
  155.  
  156. "!!!
  157. Again? (Y/N) " ?' R : R. 'Y - R. 'y - * 0 = [&HELP&]
  158.  
  159. ~ Macros follow
  160.  
  161. $Z ~ Clear screen
  162.  
  163. K. 'K - K. 'k - * 0 = [ 'Z '@ - !' @ ]  ~  Kaypro
  164. K. 'R - K. 'r - * 0 = [ '7 '1 'T '[ '@ - !' !' !' !' @ ]  ~  Royal
  165. K. 'X - K. 'x - * 0 = [ '* '[ '@ - !' !' @ ]  ~  Xerox
  166. 24 w :  ( w. ^  'J '@ - !'  w. 1 - w : ) @  ~ 24 line feed default
  167.  
  168.