» [1]    Introduction to CalcStat


   CalcStat  The current programme is a desktop calculator which allows you
to perform calculations at will, store the results in lists and re-load these
at some later point. 

   To begin with users should be aware of the difference in the two basic modes
of CalcStat. These are called the Single Expression and List Processing modes
respectively. You can switch between the two modes by pressing the F3 key which
acts as a toggle; it can only be used when you are not actually entering data.
When you start CalcStat you cannot type in data immediately. Instead you must
press a key which leads to the data prompt line appearing. Before this occurs
you can determine the input mode with the F3 key.

   By default the Single Expression mode is active. You notice this as there is
a single input line in the lower half of the screen and the current mode is 
displayed in the upper right-hand corner. In the List Processing mode a long
vertical window on the right of the screen is to be seen; numbers are entered 
here (or a file with a list of numbers is loaded via Shift-F10).

«
» [2]    Single Expressions (1)


Single Expression means that you enter the data for a computation in a single
line (technically called an expression). An example would be the following:

         (234 + 56.78) / (4.77 * 1.39) - 604

   After entering this line you press the Return key and the expression is eva-
luated with the result being displayed in the upper right-hand window. Express-
ions can be formed at will, bearing in mind that brackets are necessary in many
cases to make sure that operator precedence does not cross with your intentions
for a particular computation. After a computation has been carried out the data
prompt line is empty and you can enter a new line. You may of course retrieve a
previous line by using the UpArrow, DownArrow keys and pressing Return. This is
convenient if you wish to carry out a computation similar to a former one: just
add the changes and evaluate the line again. 

   N.B. You must be careful with extreme calculations. In some rare cases the
value computed may be out of range; the result box then displays a row of 9's. 

«
» [3]    Single Expressions (2)


   Expressions are only possible with operators which take more than one oper-
and. These are the basic four functions +, - , *, / along with % (percent), ^
(power) and m (modulo). Unary operators, e.g. l (natural logarithm), are placed
after a single constant (number) and then evaluated as in: 34 l <Return>.  

   The set of legal operators in CalcStat is:

   1)    +    Addition                2)    -    Substraction
   3)    *    Multiplication          4)    /    Division
   5)    %    Percentage              6)    ^    Power
   7)    e    Exponential function    8)    √    Square root  (√ = <Alt>+251)
   9)    m    Modulo                  10)   f    Fibonacci number
   11)   !    Factorial               12)   l    Natural logarithm
   13)   l10  Logarithm base 10       14)   s    Sine
   15)   c    Cosine                  16)   t    Tangent
   17)   h    Hypotenuse              18)   as   Arc sine
   19)   ac   Arc cosine              20)   at   Arc tangent
   21)   sh   Hyperbolic sine         22)   ch   Hyperbolic cosine
   23)   th   Hyperbolic tangent

«
» [4]    Single Expressions (3)

1)  Operands and operators must be separated by a blank.

2)  An operand can be up to 12 digits long in the single expression mode and 8
in the List Processing mode with floating point precision up to 4 decimal places
(values greater than these are truncated to the legal maxima). 

3)  An illegal expression is recognized by the system and the computer either
beeps or the result is zero. In each case you can retrieve the defective ex-
pression by means of the UpArrow key and correct it. 

4)  Calculations are made to 16 places before and 4 after a decimal point. If
you try to compute a number beyond 16 digits some or all of the decimal points
are lost. If the number computed has more than 20 places before the decimal
point then the right-most of these are lost.

5)  A factorial can only be calculated for a value up to 20, a Fibonacci number
with one of up to 25.

6)  To save the results of the current computation and of all previous ones,
press the F10 key. Expressions and results are stored in a file with the auto-
matic extension ".FIL". Information is always appended to existing files.

«
» [5]    List Processing (1)


   If not active, press F3 for the List Processing mode. You can enter numeric
data in the long vertical window on the right, one value per line. These values
are collected in an array; up to 2048 values can be entered. After typing in
all the values you wish, use Escape to finish. Now you may proceed with a
calculation by pressing F5 for "Calc". A window appears on the right and you
are presented with 11 options of a statistical nature. Their functions are ob-
vious from the names listed in the pick list window. If you choose a single
option it is calculated and displayed in the result box. After this, you are
given the choice of saving it to file. However, if you wish to carry out all
the statistical calculations, then simply press Ctrl-F5 when the pick list
window appears. The screen changes and you are shown a table with various cal-
culations for the values you entered. Press any key to return to the desktop.
You are then prompted to enter a name (without extension) for two files which
CalcStat now generates, one with the extension ".CAL" and one with ".BAR", the
latter being a bar chart derived from the numeric data in the List Processing
array just stored. The intention of a bar chart is to offer visual representa-
tion of relationships between numbers. Depending on the maximum in the list,
one block ('█') represents 0.01, 0.1, 1, 10, 100, 1000 or 10,000.

«
» [6]    List Processing (2)


   Irrespective of whether you perform a calculation, the List Processing array
retains its contents which can be edited later on (in the same work session)
by pressing F6. The same window as when entering data appears. You can scroll
in the list with the following legal keystrokes:

	Up/DownArrow        Previous/Next value
	PageUp/Down         Up/Down a windowful
	Ctrl-PgUp/Dn        First/Last value of list

To edit a value press Return. A cursor appears and you can change the value;
pressing Return again leads to the altered value being stored in the list. To
add a new value to the list, press Shift-DownArrow. The bar jumps to the end of
the list and adds an empty value which can now be filled.

   If you save a List Processing list with F4 then this can be retrieved into
CalcStat (and further edited) by using Shift-F10 to load it. You can further-
more specify such a file on the command line when starting CalcStat as in:
"cstat values.lst". When you do so you automatically enter the list editing
mode.

«
» [7]    Function Key Settings


   F1  Help screen     Shift-F1, Ins  DOS command   Ctrl-F1  DOS call
 
   F2  Number search   Shift-F2  Continue search     

   F3  Switch modes
 
   F4  Save .LST file  Shift-F4  Save .DBF file     Ctrl-F4  Just clear memory

   F5  Calculate list                               Ctrl-F5  All calculations
                                                    Alt-F5   (Calc Mode also)
   F7  Exit CalcStat

   F8  Expression history

   F9  Show environment

   F10 Save all data   Shift-F10 Load file from disk

«
» [8]    Line Editor Commands


The input line in the "Single Expression" mode can be edited in a flexible
manner by using various keys as follows:


	Up/DownArrow       Previous/Next line

	Left/RightArrow    Previous/Next character
	Home/End           Beginning/End of line
	BackSpace          Delete character to left
	Delete             Delete current character
	Ctrl-End           Delete to end of line


   CalcStat can store up to 32 expressions (and 1024 numbers "List Processing"
mode) in a list. If you exceed this the DownArrow key will lead you to the
first line, i.e. entries are kept in a circular queue.

   You may check on previous expressions by pressing the History key, F8.

«
» [9]    CalcStat File Types 


	1)  .LST  =  List of collected values (can serve as input
                     again if re-loaded)
	2)  .DBF  =  dBASE compatible database with collected values
	3)  .FIL  =  Single expressions calculated and any collected 
                     values present in memory
	4)  .CAL  =  Collected values and statistical calculations 
                     performed on them
	5)  .BAR  =  Bar chart of collected values (only generated after
                     Ctrl-F5 being pressed and user writing calculation 
                     results to file)

Note file types 3) and 4) are written when you force all calculations to be
made on a value list (with Ctrl-F5). If you perform a single calculation with
F5 you have the option of storing it to a .CAL file, but without a bar chart
being generated and saved. 

All files which CalcStat creates contain pure ASCII text and so can be pro-
cessed with any other software, e.g. Aran Draft. Furthermore, the files are
created afresh each time which means that any file with the same name is auto-
matically overwritten, so be careful when specifying an output file name!

«
» [10]   Command Line Parameters



    CalcStat call syntax



	(i)   cstat file_name

	file_name  =  Name of file with numbers from a previous editing
	session. This file must have the extension ".LST", i.e. it must
	be a list file generated in the "List Processing" mode.



	(ii)  cstat /c

	/c = Automatically enter the "List Processing" mode (the default
 	is the "Single Expression" mode).

«
» [11]   Lower ASCII Area


          │     │     │     │     │     │     │     │     │     │     
          │     │     │     │     │     │     │     │     │     │     
          │  0  │  1  │  2  │  3  │  4  │  5  │  6  │  7  │  8  │  9  
──────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼──────────────
       0  │ NUL │ SOH │ STX │ ETX │ EOT │ ENQ │ ACK │ BEL │ BS  │  HT 
       1  │  LF │  VT │  FF │  CR │  SO │  SI │ DLE │ DC1 │ DC2 │ DC3 
       2  │ DC4 │ NAK │ SYN │ ETB │ CAN │  EM │ SUB │ ESC │  FS │  GS 
       3  │  RS │  US │  SP │  !  │  "  │  #  │  $  │  %  │  &  │  '  
       4  │  (  │  )  │  *  │  +  │  ,  │  -  │  .  │  /  │  0  │  1  
       5  │  2  │  3  │  4  │  5  │  6  │  7  │  8  │  9  │  :  │  ;  
       6  │  <  │  =  │  >  │  ?  │  @  │  A  │  B  │  C  │  D  │  E  
       7  │  F  │  G  │  H  │  I  │  J  │  K  │  L  │  M  │  N  │  O  
       8  │  P  │  Q  │  R  │  S  │  T  │  U  │  V  │  W  │  X  │  Y  
       9  │  Z  │  [  │  \  │  ]  │  ^  │  _  │  `  │  a  │  b  │  c  
      10  │  d  │  e  │  f  │  g  │  h  │  i  │  j  │  k  │  l  │  m  
      11  │  n  │  o  │  p  │  q  │  r  │  s  │  t  │  u  │  v  │  w  
      12  │  x  │  y  │  z  │  {  │  |  │  }  │  ~  │ DEL │     │     
          │     │     │     │     │     │     │     │     │     │     
          │     │     │     │     │     │     │     │     │     │     
          │     │     │     │     │     │     │     │     │     │     
«
» [12]   Upper ASCII Area


          │     │     │     │     │     │     │     │     │     │     
          │     │     │     │     │     │     │     │     │     │     
          │  0  │  1  │  2  │  3  │  4  │  5  │  6  │  7  │  8  │  9  
──────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼──────────────
      12  │     │     │     │     │     │     │     │     │  Ç  │  ü  
      13  │  é  │  â  │  ä  │  à  │  å  │  ç  │  ê  │  ë  │  è  │  ï  
      14  │  î  │  ì  │  Ä  │  Å  │  É  │  æ  │  Æ  │  ô  │  ö  │  ò  
      15  │  û  │  ù  │  ÿ  │  Ö  │  Ü  │  ¢  │  £  │  ¥  │  ₧  │  ƒ  
      16  │  á  │  í  │  ó  │  ú  │  ñ  │  Ñ  │  ª  │  º  │  ¿  │  ⌐  
      17  │  ¬  │  ½  │  ¼  │  ¡  │  «  │  »  │  ░  │  ▒  │  ▓  │  │  
      18  │  ┤  │  ╡  │  ╢  │  ╖  │  ╕  │  ╣  │  ║  │  ╗  │  ╝  │  ╜  
      19  │  ╛  │  ┐  │  └  │  ┴  │  ┬  │  ├  │  ─  │  ┼  │  ╞  │  ╟  
      20  │  ╚  │  ╔  │  ╩  │  ╦  │  ╠  │  ═  │  ╬  │  ╧  │  ╨  │  ╤  
      21  │  ╥  │  ╙  │  ╘  │  ╒  │  ╓  │  ╫  │  ╪  │  ┘  │  ┌  │  █  
      22  │  ▄  │  ▌  │  ▐  │  ▀  │  α  │  ß  │  Γ  │  π  │  Σ  │  σ  
      23  │  µ  │  τ  │  Φ  │  Θ  │  Ω  │  δ  │  ∞  │  φ  │  ε  │  ∩  
      24  │  ≡  │  ±  │  ≥  │  ≤  │  ⌠  │  ⌡  │  ÷  │  ≈  │  °  │  ∙  
      25  │  ·  │  √  │  ⁿ  │  ²  │  ■  │     │     │     │     │     
          │     │     │     │     │     │     │     │     │     │     
          │     │     │     │     │     │     │     │     │     │     

«
» [13]   ASCII Control Codes


Printer control codes, ASCII 0 - 32


    ^@,  $0   NUL = Null                 ^A,  $1   SOH = Start of Heading 
    ^B,  $2   STX = Start of Text        ^C,  $3   ETX = End of Text      
    ^D,  $4   EOT = End of Trans.        ^E,  $5   ENQ = Enquiry          
    ^F,  $6   ACK = Acknowledge          ^G,  $7   BEL = Bell             
    ^H,  $8   BS  = Backspace            ^I,  $9   HT  = Horizontal Tab    
    ^J,  $10  LF  = Line Feed            ^K,  $11  VT  = Vertical Tab     
    ^L,  $12  FF  = Form Feed            ^M,  $13  CR  = Carriage Return  
    ^N,  $14  SO  = Shift Out            ^O,  $15  SI  = Shift In         
    ^P,  $16  DLE = Data Link Esc        ^Q,  $17  DC1 = Device Control 1 
    ^R,  $18  DC2 = Device Control 2     ^S,  $19  DC3 = Device Control 3 
    ^T,  $20  DC4 = Device Control 4     ^U,  $21  NAK = Neg. Acknowledge 
    ^V,  $22  SYN = Synchronous Idle     ^W,  $23  ETB = End of Tr.Block  
    ^X,  $24  CAN = Cancel               ^Y,  $25  EM  = End of Medium    
    ^Z,  $26  SUB = Substitute           ^[,  $27  ESC = Escape           
    ^\,  $28  FS  = Form Separator       ^],  $29  GS  = Group Separator  
    ^^,  $30  RS  = Record Separator     ^_,  $31  US  = Unit Separator   
«
» [14]   Decimal-Hex-Binary (1)

         ^@    0  00  0000 0000     │     Ç   128  80  1000 0000      
         ^A    1  01  0000 0001     │     ü   129  81  1000 0001      
         ^B    2  02  0000 0010     │     é   130  82  1000 0010      
         ^C    3  03  0000 0011     │     â   131  83  1000 0011      
         ^D    4  04  0000 0100     │     ä   132  84  1000 0100      
         ^E    5  05  0000 0101     │     à   133  85  1000 0101      
         ^F    6  06  0000 0110     │     å   134  86  1000 0110      
         ^G    7  07  0000 0111     │     ç   135  87  1000 0111      
         ^H    8  08  0000 1000     │     ê   136  88  1000 1000      
         ^I    9  09  0000 1001     │     ë   137  89  1000 1001      
         ^J   10  0A  0000 1010     │     è   138  8A  1000 1010      
         ^K   11  0B  0000 1011     │     ï   139  8B  1000 1011      
         ^L   12  0C  0000 1100     │     î   140  8C  1000 1100      
         ^M   13  0D  0000 1101     │     ì   141  8D  1000 1101      
         ^N   14  0E  0000 1110     │     Ä   142  8E  1000 1110      
         ^O   15  0F  0000 1111     │     Å   143  8F  1000 1111      
         ^P   16  10  0001 0000     │     É   144  90  1001 0000      
         ^Q   17  11  0001 0001     │     æ   145  91  1001 0001      
         ^R   18  12  0001 0010     │     Æ   146  92  1001 0010      
         ^S   19  13  0001 0011     │     ô   147  93  1001 0011      
         ^T   20  14  0001 0100     │     ö   148  94  1001 0100      
«
» [15]   Decimal-Hex-Binary (2)


         ^U   21  15  0001 0101     │     ò   149  95  1001 0101      
         ^V   22  16  0001 0110     │     û   150  96  1001 0110      
         ^W   23  17  0001 0111     │     ù   151  97  1001 0111      
         ^X   24  18  0001 1000     │     ÿ   152  98  1001 1000      
         ^Y   25  19  0001 1001     │     Ö   153  99  1001 1001      
         ^Z   26  1A  0001 1010     │     Ü   154  9A  1001 1010      
         ^[   27  1B  0001 1011     │     ¢   155  9B  1001 1011      
         ^\   28  1C  0001 1100     │     £   156  9C  1001 1100      
         ^]   29  1D  0001 1101     │     ¥   157  9D  1001 1101      
         ^^   30  1E  0001 1110     │     ₧   158  9E  1001 1110      
         ^_   31  1F  0001 1111     │     ƒ   159  9F  1001 1111      
              32  20  0010 0000     │     á   160  A0  1010 0000      
          !   33  21  0010 0001     │     í   161  A1  1010 0001      
          "   34  22  0010 0010     │     ó   162  A2  1010 0010      
          #   35  23  0010 0011     │     ú   163  A3  1010 0011      
          $   36  24  0010 0100     │     ñ   164  A4  1010 0100      
          %   37  25  0010 0101     │     Ñ   165  A5  1010 0101      
          &   38  26  0010 0110     │     ª   166  A6  1010 0110      
          '   39  27  0010 0111     │     º   167  A7  1010 0111      
          (   40  28  0010 1000     │     ¿   168  A8  1010 1000      
«
» [16]   Decimal-Hex-Binary (3)


          )   41  29  0010 1001     │     ⌐   169  A9  1010 1001      
          *   42  2A  0010 1010     │     ¬   170  AA  1010 1010      
          +   43  2B  0010 1011     │     ½   171  AB  1010 1011      
          ,   44  2C  0010 1100     │     ¼   172  AC  1010 1100      
          -   45  2D  0010 1101     │     ¡   173  AD  1010 1101      
          .   46  2E  0010 1110     │     «   174  AE  1010 1110      
          /   47  2F  0010 1111     │     »   175  AF  1010 1111      
          0   48  30  0011 0000     │     ░   176  B0  1011 0000      
          1   49  31  0011 0001     │     ▒   177  B1  1011 0001      
          2   50  32  0011 0010     │     ▓   178  B2  1011 0010      
          3   51  33  0011 0011     │     │   179  B3  1011 0011      
          4   52  34  0011 0100     │     ┤   180  B4  1011 0100      
          5   53  35  0011 0101     │     ╡   181  B5  1011 0101      
          6   54  36  0011 0110     │     ╢   182  B6  1011 0110      
          7   55  37  0011 0111     │     ╖   183  B7  1011 0111      
          8   56  38  0011 1000     │     ╕   184  B8  1011 1000      
          9   57  39  0011 1001     │     ╣   185  B9  1011 1001      
          :   58  3A  0011 1010     │     ║   186  BA  1011 1010      
          ;   59  3B  0011 1011     │     ╗   187  BB  1011 1011      
          <   60  3C  0011 1100     │     ╝   188  BC  1011 1100      
«
» [17]   Decimal-Hex-Binary (4)


          =   61  3D  0011 1101     │     ╜   189  BD  1011 1101      
          >   62  3E  0011 1110     │     ╛   190  BE  1011 1110      
          ?   63  3F  0011 1111     │     ┐   191  BF  1011 1111      
          @   64  40  0100 0000     │     └   192  C0  1100 0000      
          A   65  41  0100 0001     │     ┴   193  C1  1100 0001      
          B   66  42  0100 0010     │     ┬   194  C2  1100 0010      
          C   67  43  0100 0011     │     ├   195  C3  1100 0011      
          D   68  44  0100 0100     │     ─   196  C4  1100 0100      
          E   69  45  0100 0101     │     ┼   197  C5  1100 0101      
          F   70  46  0100 0110     │     ╞   198  C6  1100 0110      
          G   71  47  0100 0111     │     ╟   199  C7  1100 0111      
          H   72  48  0100 1000     │     ▄   200  C8  1100 1000      
          I   73  49  0100 1001     │     ╔   201  C9  1100 1001      
          J   74  4A  0100 1010     │     ╩   202  CA  1100 1010      
          K   75  4B  0100 1011     │     ╦   203  CB  1100 1011      
          L   76  4C  0100 1100     │     ╠   204  CC  1100 1100      
          M   77  4D  0100 1101     │     ═   205  CD  1100 1101      
          N   78  4E  0100 1110     │     ╬   206  CE  1100 1110      
          O   79  4F  0100 1111     │     ╧   207  CF  1100 1111      
          P   80  50  0101 0000     │     ╨   208  D0  1101 0000      
«
» [18]   Decimal-Hex-Binary (5)


          Q   81  51  0101 0001     │     ╤   209  D1  1101 0001      
          R   82  52  0101 0010     │     ╥   210  D2  1101 0010      
          S   83  53  0101 0011     │     ╙   211  D3  1101 0011      
          T   84  54  0101 0100     │     ╘   212  D4  1101 0100      
          U   85  55  0101 0101     │     ╒   213  D5  1101 0101      
          V   86  56  0101 0110     │     ╓   214  D6  1101 0110      
          W   87  57  0101 0111     │     ╫   215  D7  1101 0111      
          X   88  58  0101 1000     │     ╪   216  D8  1101 1000      
          Y   89  59  0101 1001     │     ┘   217  D9  1101 1001      
          Z   90  5A  0101 1010     │     ┌   218  DA  1101 1010      
          [   91  5B  0101 1011     │     █   219  DB  1101 1011      
          \   92  5C  0101 1100     │     ▄   220  DC  1101 1100      
          ]   93  5D  0101 1101     │     ▌   221  DD  1101 1101      
          ^   94  5E  0101 1110     │     ▐   222  DE  1101 1110      
          _   95  5F  0101 1111     │     ▀   223  DF  1101 1111      
          `   96  60  0110 0000     │     α   224  E0  1110 0000      
          a   97  61  0110 0001     │     ß   225  E1  1110 0001      
          b   98  62  0110 0010     │     Γ   226  E2  1110 0010      
          c   99  63  0110 0011     │     π   227  E3  1110 0011      
          d   100 64  0110 0100     │     Σ   228  E4  1110 0100      
«
» [19]   Decimal-Hex-Binary (6)


          e   101 65  0110 0101     │     σ   229  E5  1110 0101      
          f   102 66  0110 0110     │     µ   230  E6  1110 0110      
          g   103 67  0110 0111     │     τ   231  E7  1110 0111      
          h   104 68  0110 1000     │     Φ   232  E8  1110 1000      
          i   105 69  0110 1001     │     Θ   233  E9  1110 1001      
          j   106 6A  0110 1010     │     Ω   234  EA  1110 1010      
          k   107 6B  0110 1011     │     δ   235  EB  1110 1011      
          l   108 6C  0110 1100     │     ∞   236  EC  1110 1100      
          m   109 6D  0110 1101     │     φ   237  ED  1110 1101      
          n   110 6E  0110 1110     │     ε   238  EE  1110 1110      
          o   111 6F  0110 1111     │     ∩   239  EF  1110 1111      
          p   112 70  0111 0000     │     ≡   240  F0  1111 0000      
          q   113 71  0111 0001     │     ±   241  F1  1111 0001      
          r   114 72  0111 0010     │     ≥   242  F2  1111 0010      
          s   115 73  0111 0011     │     ≤   243  F3  1111 0011      
          t   116 74  0111 0100     │     ⌠   244  F4  1111 0100      
          u   117 75  0111 0101     │     ⌡   245  F5  1111 0101      
          v   118 76  0111 0110     │     ÷   246  F6  1111 0110      
          w   119 77  0111 0111     │     ≈   247  F7  1111 0111      
          x   120 78  0111 1000     │     °   248  F8  1111 1000      
«
» [20]   Decimal-Hex-Binary (7)


          y   121 79  0111 1001     │     ∙   249  F9  1111 1001      
          z   122 7A  0111 1010     │     ·   250  FA  1111 1010      
          {   123 7B  0111 1011     │     √   251  FB  1111 1011      
          |   124 7C  0111 1100     │     ⁿ   252  FC  1111 1100      
          }   125 7D  0111 1101     │     ²   253  FD  1111 1101      
          ~   126 7E  0111 1110     │     ■   254  FE  1111 1110      
              127 7F  0111 1111     │         255  FF  1111 1111      
«
