home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / spread / rebel302.zip / CHAP5-11.DOC < prev    next >
Text File  |  1993-05-01  |  177KB  |  3,688 lines

  1.     
  2.                                                    _______________________
  3.     ______________________________________________/  Chapter 5   EDIT MODE
  4.  
  5.  
  6.     From the Input Line, your editing capabilities are limited to erasing 
  7.     the last character typed with the <Backspace> key.  In addition, 
  8.     there is no way of modifying the contents of existing cells - short of 
  9.     retyping them. Obviously, if you are working with long complicated 
  10.     formulas, this could be a tedious way of correcting errors or making 
  11.     changes. 
  12.  
  13.     To provide you with more flexibility in this area, a special set of 
  14.     function key options are available, that will allow you to revise the 
  15.     contents of existing cells. Specifically, you will be able to;  1) use 
  16.     the arrow keys to move the input cursor:  2) delete characters;  3) 
  17.     insert new characters;  4) search and replace patterns of characters;  
  18.     5) 'capture' a series of characters to be re-inserted at a different 
  19.     location within the same or different entries;  6) incorporate the 
  20.     formulas and labels of other cells into the cell being edited;  7) 
  21.     locate closing brackets;  8) display error messages; and  9) single step 
  22.     through formula calculations, allowing you to check the intermediate 
  23.     results of each operation as an expression is evaluated. 
  24.  
  25.     To enter the 'Edit Mode', move the Cell Pointer to the cell you wish to 
  26.     modify and press the <F2> function key TWICE from the Root Menu. The 
  27.     contents of that cell along with the Edit Mode Function Key Options 
  28.     should appear just above the Column Bar.  You can now use the arrow keys 
  29.     to move the input cursor to any location within the entry.  The <Up> 
  30.     arrow will move you immediately to the beginning of the entry, while the 
  31.     <Down> arrow will move you back to the end.  There is also an 'insert' 
  32.     and 'overlay' character mode that will allow you to insert new 
  33.     characters or overwrite existing ones.  The F1 (INS) option will toggle 
  34.     you between them (refer to the section below).  And, you can use either 
  35.     the <Del> key or F2 (DEL) option to delete  characters.  Try entering 
  36.     the Edit Mode with the Cell Pointer positioned on an empty cell and 
  37.     experimenting with each of these  options.  Remember, you can use the 
  38.     <Esc> key at any time to abort. 
  39.  
  40.     After you have made your changes, you can save them by pressing the 
  41.     <Enter> key.  If a problem is detected with an expression when exiting 
  42.     the Edit Mode, an error message will appear at the top of your screen 
  43.     and you will be returned to make the necessary changes.  This differs 
  44.     from the way in which errors are handled from the Input Line.  Here, no 
  45.     error messages will appear.  Instead, only a series of question marks 
  46.     (????) will be displayed in the cell(s) that have detected a problem and 
  47.     you are allowed to continue as though nothing has happened.  You can get 
  48.     a general idea of what went wrong in these cases by moving the Cell 
  49.     Pointer to the cell that contains the question marks and then entering 
  50.     the Edit Mode.  This will cause an error message to be displayed that 
  51.     will hopefully help you determine what when wrong.  If you are unable to 
  52.     correct the problem from within the Edit Mode, use the <Esc> key to 
  53.     exit.  You can return at a later time to fix the problem.  Be aware, 
  54.     however, that when you abort the Edit Mode (after an error has been 
  55.     detected), the spreadsheet will sometimes insert a single quote (') at 
  56.     the beginning of the expression.  If this happens, you must remove the 
  57.     quote before the expression can be re-evaluated. 
  58.  
  59.  
  60.  
  61.  
  62.                   .........
  63.                   :  f2   :  From the "Root Menu", press F2
  64.                   : EDIT  :
  65.  
  66.                   .........
  67.                   :  f2   :  then press F2 again
  68.                   : Edit  :
  69.  
  70.                   _____   _____   _____   _____   _____
  71.      EDITING:    |1 INS| |2 DEL| |3 RPL| |4  GO| |5 CUT| . . .
  72.  
  73.  
  74.           f1   -   Toggles between INSERT and OVERWRITE entry modes. When
  75.                    the descriptive word is displayed in capital letters
  76.                    (INS), you're in the 'overwrite' mode.  This means that
  77.                    any character you type will be added to the end of the
  78.                    entry or will overwrite an existing character, depending
  79.                    on the  cursor position.  When the insert identifier is
  80.                    displayed with lower case letters (ins), you're in the 
  81.                    'insert' mode.  In this case, new characters are placed
  82.                    between existing characters.
  83.  
  84.           f2   -   This key DELETES the character at the current cursor
  85.                    position.  It works just like the <Del> key on your
  86.                    keyboard.
  87.  
  88.           f3   -   SEARCHES the entry for a pattern of characters and 
  89.                    REPLACES them with another pattern.  You will be prompted 
  90.                    to enter both of these patterns. 
  91.  
  92.           f4   -   MOVES the Cell Pointer to another cell location on the 
  93.                    worksheet -  without forcing you to exit the Edit Mode.  
  94.                    This allows you to view the contents of other cells; and, 
  95.                    if you like, to use the F7 (LBL) option to incorporate 
  96.                    them into the current entry. 
  97.  
  98.          f5    -   CUTS (captures) a series of characters from the text that 
  99.                    is currently being edited, placing them into the 'cut' 
  100.                    buffer.  This buffer can then be re-inserted at any 
  101.                    location within the entry.  To execute the command, press 
  102.                    the F5 key with the cursor positioned on the first 
  103.                    character of the string you wish to capture. Additional 
  104.                    characters will continue to be placed into this buffer 
  105.                    while the cursor is moved to the right with the Right 
  106.                    <Arrow> Key.  Do not press any other key (other than the 
  107.                    right arrow key) until AFTER you have TERMINATED THE 
  108.                    'CUT' OPERATION BY PRESSING THE F5 KEY A SECOND TIME.  
  109.                    The buffer's contents are preserved until the process is 
  110.                    repeated (i.e. they are not lost when you exit the Edit 
  111.                    Mode).  This allows you to insert the buffer into other 
  112.                    cells, as well.  The F6 (PUT) option is used to copy the 
  113.                    contents of the 'cut' buffer back into the entry, at any 
  114.                    cursor position you like. 
  115.  
  116.                                      _____   _____   _____   _____   _____
  117.                               . . . |6 PUT| |7 LBL| |8 ADR| |9 DBG| | [()]|
  118.  
  119.           f6   -   PUTS (inserts) the contents of the 'CUT' buffer into the 
  120.                    entry at the current cursor location (see the F5 'CUT' 
  121.                    option). 
  122.  
  123.           f7   -   Inserts the 'formula' or 'label' of the cell that is 
  124.                    highlighted by the Cell Pointer into the entry - at the 
  125.                    current cursor location. The F4 (GO) command can be used 
  126.                    to move the Cell Pointer to the cell that contains 
  127.                    statement you wish to capture.  While in the Edit Mode, 
  128.                    the <Home>, <End>, <Pg Up>, and <Pg Dn> Keys can also be 
  129.                    used to move the Cell Pointer, one cell at a time. 
  130.  
  131.           f8   -   This option works like the F7 (LBL) command except that
  132.                    it inserts the 'Cell Address' of the cell that is
  133.                    highlighted by the Cell Pointer into the current entry.
  134.  
  135.           f9   -   This command is used to debug a 'formula' by allowing you 
  136.                    to evaluate it - one step at a time.  After each 
  137.                    operation, it will pause and display the value calculated 
  138.                    or substituted.  Press the <Enter> key to continue to the 
  139.                    next operation. 
  140.  
  141.           f0   -   With the cursor placed on any square bracket [] or
  142.                    parenthesis (), this option will cause the cursor to
  143.                    jump to its CLOSING bracket.  This command also works
  144.                    with the ?:; (arithmetic-if) delimiters.
  145.  
  146.  
  147.  
  148.  
  149.                                              ____________________________
  150.    _________________________________________/  Chapter 6   TECHNICAL INFO
  151.  
  152.  
  153.  
  154.  
  155.  
  156.     This chapter is designed to provide you with a more detailed explanation 
  157.     of the more important topics covered thus far.  Every attempt has been 
  158.     made to keep each of these sections as short and to the point as 
  159.     possible.  The first six contain most of the what you'll need to use 
  160.     REBEL effectively.  It's highly recommended, however, that you read them 
  161.     all - in the order they are presented, since each section tends to build 
  162.     on the information that precedes it. 
  163.  
  164.  
  165.  
  166.  
  167.     -----------------------------------------------------------------------
  168.     Section  6:1   CELL TYPES
  169.     -----------------------------------------------------------------------
  170.  
  171.     A FORMULA, LABEL, or VARIABLE LABEL cell is created each time an entry 
  172.     is made (limited to 255 characters) from the Input Line.  The specific 
  173.     type of cell created depends on whether the entry is interpreted as a 
  174.     mathematical expression (a formula) or a string of characters (a label).  
  175.     For the most part, this is done automatically by the spreadsheet, which 
  176.     will attempt to make an educated guess based on the first character of 
  177.     your entry.  It is important that the correct decision is made (and in 
  178.     most cases it is), since the cell 'type' governs the way in which a 
  179.     cell's data can be used by other cells. 
  180.     
  181.     FORMULA CELLS are created whenever a mathematical expression (formula) 
  182.     is entered at the Input Line.  This can be anything from a simple 
  183.     number to a complex set of arithmetic operations.  To be interpreted 
  184.     as such, it must begin with one of the following characters: 
  185.  
  186.                      + - . [ ( 0 1 2 3 4 5 6 7 8 9 @
  187.  
  188.     There are, however, times when an otherwise valid expression may not 
  189.     begin with one of the above characters (i.e. expressions that begin 
  190.     with function calls).  In these situations, you must FORCE the 
  191.     spreadsheet to interpret your entry as a 'formula' by beginning it 
  192.     with a plus sign (+).  For example, the formula "sqrt(16)" should be 
  193.     entered as "+sqrt(16)" to prevent it from being interpreted as a 
  194.     'label'.  The plus sign (+) will not affect the results. 
  195.  
  196.     LABEL CELLS are created whenever an entry is made that DOES NOT begin 
  197.     with one of the characters that denotes a formula.  Labels consist of a 
  198.     string of characters that appear on the screen exactly as they are typed 
  199.     from the Input Line.  The spreadsheet makes no attempt to interpret 
  200.     these entries in any way.  If a label is longer than the column width 
  201.     of the cell that it's stored, it will overlap up to to 63 adjacent empty 
  202.     cells before its display is finally terminated.  Just as with formulas, 
  203.     there are occasions when a label will begin with a character that can 
  204.     cause some confusion.  For example, the string "1st of January" begins 
  205.     with a '1'.  If typed in as it stands, the spreadsheet will look at the 
  206.     first character and think: "this is a formula", and it will create a 
  207.     FORMULA CELL to store it in.  This, of course, will produce an error 
  208.     when the spreadsheet attempts to calculate its value!  That is, what 
  209.     does "1st of January" mean mathematically?  It is easy to tell when this 
  210.     has occurred by the question marks (?????) that are displayed by the 
  211.     cell instead of the label you expected.  The solution is simple -  just 
  212.     begin the label with a single quote (').  This will FORCE the 
  213.     spreadsheet to view the entry as a label, rather than a formula.  The 
  214.     leading single quote will not appear when the string is displayed. 
  215.  
  216.     VARIABLE LABEL CELLS are created ONLY when labels are entered that 
  217.     begins with a double quote (").  Unlike the single quote ('), which is 
  218.     often not necessary for standard labels, THE DOUBLE QUOTE IS REQUIRED 
  219.     FOR VARIABLE LABELS.   Like standard labels, variable labels display 
  220.     everything in the character string (just as its appears) - except for 
  221.     Cell Addresses.  When a Cell Address (e.g. [1,2]) is encountered, the 
  222.     contents of THAT cell is displayed, rather than the Cell Address itself.  
  223.     For example, if cell [1,2] contains the string "red", an entry such as 
  224.     this: 
  225.                                 "The car is [1,2].
  226.     would be displayed as:
  227.                                  The car is red.
  228.  
  229.  
  230.     UNDEFINED CELLS are automatically created by the spreadsheet when a 
  231.     reference is made to an 'empty' cell.  These cells are easily identified 
  232.     by the long underscore (________) they display. They can be removed 
  233.     either by eliminating the references to them or by making a valid entry 
  234.     in their place.  Normally, a reference to an UNDEFINED (empty) cell 
  235.     within a formula will produce questionable results. When this occurs, a 
  236.     series of question marks (?????) will appear in the display of the cell 
  237.     that contains the reference.  You can locate the UNDEFINED cells that 
  238.     another cell is addressing with the F8 (Affect) command discussed in
  239.     Section 4:7.
  240.     
  241.      
  242.     -----------------------------------------------------------------------
  243.     Section  6:2   CELL ADDRESSES
  244.     -----------------------------------------------------------------------
  245.  
  246.     A CELL ADDRESS (e.g. [row,column]) is simply a way of referencing 
  247.     another cell's value within a formula.  Not only do Cell Addresses allow 
  248.     you to access the values of other cells, but they also cause the 
  249.     formulas that use them to be recalculated when the values of the cells 
  250.     they reference are changed.  Cell Addresses are composed of four (4) 
  251.     parts or fields (the Row, Column, Array Element, and Worksheet Level) 
  252.     separated by commas and enclosed within square brackets [].  Of these, 
  253.     only the 'Row' and 'Column' fields that define the cell's position on 
  254.     the worksheet are required. 
  255.  
  256.  
  257.           REQUIRED________        _______________ OPTIONAL
  258.                      |    |      |        |
  259.                    [Row,Column,(Array),(Level)] 
  260.                                   |       |
  261.         The ARRAY ELEMENT field __|       |____ The WORKSHEET LEVEL field is
  262.         is only needed when                     only needed when accessing
  263.         accessing array values                  cells at a different level
  264.         
  265.     
  266.     The ARRAY ELEMENT field is optional and, if not used, will default to 
  267.     element position (0).  This position is reserved by a FORMULA cell to 
  268.     store the value that is the result of evaluating its formula.  It is the 
  269.     only position assigned to a FORMULA cell when it is first created and is 
  270.     generally not considered part of the array space.  As a result, array 
  271.     element numbers greater than (0) take on no real meaning until an array 
  272.     area (that can range from 1 to 8000 elements) is assigned to the cell.  
  273.     Once this is done, however, each of these element positions can be 
  274.     assigned a value that in turn can be accessed through this field. 
  275.     Although an array space can not be assigned to a LABEL cell, this field 
  276.     can be used to address the individual characters of the label itself.  
  277.     The length of the label governs the largest element number that can be 
  278.     accessed.  For additional information, see Section 6:5 on Arrays. 
  279.  
  280.     The WORKSHEET LEVEL field is also optional and defaults to the zero (0) 
  281.     when left blank.  A zero (0) in this field will always be replaced by 
  282.     the spreadsheet with the level number (ranging between 1 and 4) of the 
  283.     cell that contains the reference. This is what allows a Cell Address to 
  284.     be copied to virtually any level without requiring it to be modified.  
  285.     When a value greater than zero (0) is loaded into this field, it will 
  286.     result is an absolute reference to a cell at that level. Keep in mind, 
  287.     the Cell Addresses that uses this field may need to be modified if the 
  288.     worksheet that contains them is later loaded at a different level.  It's 
  289.     always best to leave this field BLANK when accessing cells at the same 
  290.     worksheet level (refer to Section 6:6 - Multiple Worksheets). 
  291.  
  292.         Examples:
  293.     
  294.            [1,2]       ==>       Makes a reference to the 'value' in 
  295.                                  the cell located at row 1, column 2
  296.                                  of the worksheet level that contains
  297.                                  the formula. 
  298.     
  299.            [1,2,0]     ==>       same as above. 
  300.  
  301.            [1,2,,4]    ==>       Makes an cell reference to the value
  302.                                  in the cell located at row 1, column 2
  303.                                  of worksheet level 4.
  304.     
  305.            [1,2,3]     ==>       References the value in the 3rd array
  306.                                  element of the cell located at row 1,
  307.                                  column 2 of the worksheet level that
  308.                                  contains the formula.
  309.  
  310.  
  311.     NOTE:  Because the Row, Column, Array, and Worksheet Level fields are
  312.     numbers (expressions), they can also be represented as Cell Addresses
  313.     (see section 6:9 - Indirect Cell Addresses).
  314.  
  315.  
  316.     -----------------------------------------------------------------------
  317.     Section 6:3   OPERATORS
  318.     -----------------------------------------------------------------------
  319.  
  320.     The operators provided by this spreadsheet are patterned after those 
  321.     defined in the 'C' Programming Language - with a few minor exceptions.  
  322.     The precedence of each operator is listed in following table from 
  323.     highest to lowest priority.  Parenthesis (), of course, can be used 
  324.     at any time to alter the order in which operations are performed. 
  325.     
  326.      
  327.                              UNARY OPERATORS
  328.     ---------------------------------------------------------------------
  329.     Op    Name               Use --> Result      Description
  330.     ---------------------------------------------------------------------
  331.     !    Logical NOT         !0 --> 1         converts 0 (F) to 1 (True)
  332.                              !5 --> 0         converts 5 (T) to 0 (False)
  333.     -    Unary Minus         -(-5) --> 5      negates a negative 5
  334.     +    Unary Plus          +(-5) --> -5     has no affect
  335.  
  336.  
  337.                            ARITHMETIC OPERATORS
  338.     ---------------------------------------------------------------------
  339.     Op    Name               Use --> Result      Description
  340.     ---------------------------------------------------------------------
  341.     **   Exponentiation      4**2 --> 16      4 raised to the power of 2
  342.     *    Multiplication      4*2  --> 8       4 multiplied by 2
  343.     /    Division            4/2  --> 2       4 divided by 2
  344.     %    Modulo              5%3  --> 2       remainder of 5 divided by 3
  345.     +    Addition            5+3  --> 8       5 added to 3
  346.     -    Subtraction         5-1  --> 4       5 minus 1
  347.  
  348.                NOTE:  When using the modulo (%) operator, the values
  349.                of both expressions are temporarily converted to whole
  350.                numbers before the operation is performed.  The result
  351.                is always a whole number. 
  352.  
  353.  
  354.                           BITWISE (SHIFT) OPERATORS
  355.     ---------------------------------------------------------------------
  356.     Op    Name               Use --> Result      Description
  357.     ---------------------------------------------------------------------
  358.     <<   Left Shift          2<<3 --> 16       shift the bits that
  359.                                                  represent the number 2
  360.                                                  3 positions to the left
  361.  
  362.     >>   Right Shift         16>>3 --> 2       shift the bits that
  363.                                                  represent the number 2
  364.                                                  3 positions to the right
  365.  
  366.                NOTE:  The values of both expressions are temporarily 
  367.                converted to whole numbers before these operations
  368.                are performed.  The result is always a whole number. 
  369.  
  370.  
  371.                             RELATIONAL OPERATORS
  372.     ---------------------------------------------------------------------
  373.     Op    Name               Use --> Result      Description
  374.     ---------------------------------------------------------------------
  375.     ==    Equal to           4==5 --> 0 (F)    4 equals 5  (FALSE or 0)
  376.     !=    Not Equal to       2!=3 --> 1 (T)    2 does not equal 3 (TRUE)
  377.     <=    Less or Equal      2<=2 --> 1 (T)    2 is less than or equal
  378.                                                  to 2 (TRUE or 1)
  379.     >=    Greater or Equal   2>=4 --> 0 (F)    2 is not greater than or
  380.                                                  equal to 4 (FALSE or 0) 
  381.     <     Less than          2<3 -->  1 (T)    2 is less than 3 (TRUE)
  382.     >     Greater than       3>2 -->  1 (T)    3 is greater than 2 (TRUE)
  383.  
  384.  
  385.  
  386.                              BITWISE  OPERATORS
  387.     ---------------------------------------------------------------------
  388.     Op    Name               Use --> Result      Description
  389.     ---------------------------------------------------------------------
  390.     &     Bitwise AND        1&3 --> 1         bits are set where
  391.                                                  corresponding bits of
  392.                                                  both numbers are the same
  393.     |     Bitwise OR         1|3 --> 3         bits are set when either 
  394.                                                  number has a corresponding
  395.                                                  bit set
  396.  
  397.  
  398.                NOTE:  The values of both expressions are temporarily 
  399.                converted to whole numbers before these operations
  400.                are performed.  The result is always a whole number. 
  401.     
  402.  
  403.  
  404.                              LOGICAL  OPERATORS
  405.     ---------------------------------------------------------------------
  406.     Op    Name               Use --> Result      Description
  407.     ---------------------------------------------------------------------
  408.     &&    Logical AND        (1<2)&&0 --> 0(F)   if (1<2) is TRUE AND
  409.                                                    0 is TRUE (0 is FALSE) 
  410.                                                    then the result is
  411.                                                    TRUE (1)
  412.  
  413.     ||    Logical OR         (1<2)||0 --> 1(T)   if (1<2) is TRUE OR 
  414.                                                    0 is TRUE then the
  415.                                                    result is TRUE (1)
  416.  
  417.  
  418.  
  419.                             ASSIGNMENT  OPERATORS
  420.     ---------------------------------------------------------------------
  421.     Op    Name               Use                 Description
  422.     ---------------------------------------------------------------------
  423.  
  424.     IMPORTANT!  Assignments can only be made to ARRAY ELEMENTS or the 
  425.     SPECIAL REGISTERS associated to Range Operations.
  426.  
  427.  
  428.     =     Assignment         [1,1,6] = 5         assigns the value (5)
  429.                                                    to the sixth array
  430.                                                    element of cell [1,1]
  431.  
  432.     +=    addition           x += 5              same as  x = x + 5
  433.     -=    subtraction        x -= 5              same as  x = x - 5
  434.     *=    multiplication     x *= 5              same as  x = x * 5
  435.     /=    division           x /= 5              same as  x = x / 5
  436.     %=    modulo             x %= 5  (see note)  same as  x = x % 5
  437.     <<=   shift left         x <<=5  (see note)  same as  x = x << 5
  438.     >>=   shift right        x >>=5  (see note)  same as  x = x >> 5
  439.     &=    AND (bitwise)      x &= 5  (see note)  same as  x = x & 5
  440.     |=    OR  (bitwise)      x |= 5  (see note)  same as  x = x | 5
  441.  
  442.  
  443.                NOTE:  The Compound Assignments (%=  <<=  >>=  &= |=) 
  444.                will temporarily convert both operands to whole 
  445.                numbers before computing the results.  The result 
  446.                is always returned as a whole number. 
  447.  
  448.    
  449.         Example:
  450.  
  451.           1)  [1,2,1] = 5    (legal)
  452.           2)  [1,2] = 5      (illegal)
  453.           3)  [1,2,1] += 5   (takes the value in [1,2,1], adds 5 to it
  454.                               and places the results back into [1,2,1])
  455.  
  456.  
  457.  
  458.                          TERNARY CONDITIONAL OPERATOR
  459.     ---------------------------------------------------------------------
  460.     Op    Name               Use --> Result      Description
  461.     ---------------------------------------------------------------------
  462.  
  463.     ?:;   Arithmetic-If      (2>1)?5:4;  --> 5     IF 2 is greater than 1
  464.                                                    THEN(?)  5
  465.                                                    ELSE(:)  4
  466.  
  467.  
  468.                      ____ (optional assignment to an array element)
  469.                     |
  470.                     |    (TEST)         (IF TRUE)      (IF FALSE)
  471.             [r,c,a] = (Expression#1) ? Expression#2 : Expression#3 ;
  472.                                      |              |              |
  473.                                      |_________(REQUIRED)__________|
  474.  
  475.  
  476.               IF:  'Expression#1' results in a non-zero value
  477.               THEN: The expression that follows the question mark (?)
  478.                       is evaluated (i.e. 'Expression#2') and whatever
  479.                       follows the colon (:) is ignored.
  480.               ELSE: The expression that follows the colon (:) is
  481.                       evaluated (i.e. 'Expression#3').
  482.  
  483.    
  484.         Example 1    ARITHMETIC-IF
  485.  
  486.         IF the contents of cell [1,1] is greater than or equal to the
  487.         contents of cell [2,2]:  THEN multiply the contents of cell
  488.         [3,3] by 2;  ELSE multiple the contents of [3,3] by 4 and 
  489.         assigns the results of array element 6 of cell [1,2].
  490.  
  491.           (optional)        (test)        (if true)   (if false)
  492.             [1,2,6]  =  ([1,1]>=[2,2])  ?  [3,3]*2  :  [3,3]*4;
  493.  
  494.         or 
  495.  
  496.             ([1,1]>=[2,2])  ?  [1,2,6]=[3,3]*2  :  [1,2,6]=[3,3]*4;
  497.  
  498.  
  499.  
  500.     -----------------------------------------------------------------------
  501.     Section 6:4    'FORMULAS'
  502.     -----------------------------------------------------------------------
  503.  
  504.     A 'formula' is the expression (or the set of arithmetic operations) 
  505.     that is associated with a FORMULA cell when it is first created.  It 
  506.     is recalculated each time a change is made to one of the cells it 
  507.     addresses.  Since any cell can have a formula, which in turn can 
  508.     reference the results of other cells, a whole progression of 
  509.     calculations can be performed based on a single change.
  510.  
  511.     Any given cell can have only one formula assigned to it.  When 
  512.     evaluated, the result is ALWAYS stored at Element position '0' of the 
  513.     Cell Address ([1,2,0] or by default [1,2]), which is reserved for this 
  514.     purpose.  Other Element positions (i.e. those associated with the 
  515.     optional ARRAY AREA) can not have 'formulas' assigned to them.  This 
  516.     is a subtle, but important, distinction between Element position '0' 
  517.     and those that range between 1 and 8000,  which is discussed in more 
  518.     detail in the next section.  
  519.  
  520.  
  521.     -----------------------------------------------------------------------
  522.     Section 6:5   ARRAYS
  523.     -----------------------------------------------------------------------
  524.  
  525.     Arrays have two unique properties:  1) they allow you to store large 
  526.     amounts of information with very little overhead and without taking up 
  527.     large portions of your worksheet; and 2) their values can be set with 
  528.     the assignment operators (=, +=, -=, etc..). 
  529.  
  530.     Once a FORMULA CELL has been created, an ARRAY AREA of upto 8000 
  531.     values can be defined and attached to it (see Section 4:1  "Array" 
  532.     for more information on how to do this).  These values can then be 
  533.     referenced by including the Array Element field in the Cell Address.  
  534.     For example, the Cell Address "[1,2,7]" would reference the 7th array 
  535.     value assigned to the cell at row 1, column 2.  An important point to 
  536.     remember is that element position '0' IS NOT part of the ARRAY AREA.  
  537.     This position is reserved for the result of the cell's formula and is 
  538.     assigned to it when the cell is first created.  The ARRAY AREA, on the 
  539.     other hand, is defined by the user and can only be used to store 
  540.     static values or numbers.  Referencing elements outside of the array 
  541.     area (by using element numbers larger than the maximum size of the 
  542.     array space defined for the cell) will always return a value of zero 
  543.     (0). 
  544.  
  545.     Because formulas are not and cannot be associated with the values 
  546.     stored in the ARRAY AREA, modifications to these values will not 
  547.     trigger recalculations of any cell that references them; so, exercise 
  548.     caution when referencing arrays that might have their values changed 
  549.     (see Section 6:11 on Forced Recalculations for ways around this).   
  550.     Generally speaking, arrays should be reserved for relatively static 
  551.     data.  If necessary, however, array values can modified from either 
  552.     the Input Line (see Chapter 7 - Set Element) or programmatically with 
  553.     the assignment operators (see Section 6:3 - Assignment Operators).  
  554.  
  555.     When using assignment operators, the Array Element field of the Cell 
  556.     Address MUST be included and it MUST be greater than or equal to 1 and 
  557.     less than or equal to the maximum array space defined for the cell. 
  558.     You CANNOT uses an assignment operator to change the value at element 
  559.     position '0'.  Remember, this position is reserved for the cell's 
  560.     formula and is not part of the array space.  This might best be 
  561.     explained with an example.  Let's say you enter the expression "2+2" 
  562.     in cell [1,2].  In this case, the value 4 would be stored at element 
  563.     position '0' and would be displayed on the screen.  If you were then 
  564.     to type the expression "[1,2,0]=3" at another cell location, you would 
  565.     in effect be trying to tell cell [1,2] that the result of its formula 
  566.     "2+2" equals 3 - not 4!  If, on the other hand, you had entered 
  567.     "[1,2,1]=3" it would have been perfectly legal, since an array element 
  568.     simply stores a value and is not the result of a pre-assigned formula. 
  569.      
  570.     IMPORTANT:  While an Array Area can be assigned to a cell at any time, 
  571.     it is best to do it (especially for large ones) as soon as possible 
  572.     after starting up the program - before the computer's memory becomes 
  573.     fragmented.  You should also be careful when moving a cell that contains 
  574.     an array, since other cells that might reference its array elements will 
  575.     not be adjusted to account for the new location. 
  576.  
  577.     NOTE:  As previously mentioned, arrays can only be assigned to FORMULA 
  578.     cells.  This, however, does not mean that the Array Element field of 
  579.     LABEL cells is not used.  For LABELS, this field is used to address 
  580.     specific characters within a label.  For example, if cell [1,3] 
  581.     contained the label "Hello world!", [1,3,1] would address the first 
  582.     letter 'H' (or more specifically, the ASCII value for 'H' which is 72).  
  583.     The assignment operators can also be used to reset the characters of any 
  584.     label to any ASCII value ranging between 32 and 255.  Characters with 
  585.     ASCII values greater than 125 will not be saved when backing up your 
  586.     worksheet. 
  587.  
  588.  
  589.         Example 1   REFERENCING AN ARRAY ELEMENT
  590.  
  591.                                 [1,2,7] * 10
  592.  
  593.         Example 2   ASSIGNING A VALUE TO AN ARRAY ELEMENT
  594.  
  595.                           [1,2,7] = 25.0
  596.  
  597.         Example 3   LOADING AN ARRAY AREA WITH VALUES FROM THE WORKSHEET
  598.  
  599.         Load a 400 element array, defined at cell [1,50], with a range
  600.         of values that appear between cells [1,1] and [20,20] on the
  601.         worksheet (see Section 6:7  "Range Operations" for details on
  602.         how to interpret this expression).
  603.  
  604.                        [1,1 ^ 20,20; {[1,50,[#]]=[@]}]
  605.  
  606.                  NOTE: The array area for cell [1,50] must
  607.                  have been defined prior to making these
  608.                  assignments.
  609.  
  610.  
  611.     -----------------------------------------------------------------------
  612.     Section 6:6    MULTIPLE WORKSHEETS 
  613.     -----------------------------------------------------------------------
  614.     
  615.     Up to four (4) worksheets can be loaded and accessed at any given time. 
  616.     You can move between them with the F& (Level) option described in 
  617.     Section 4:6 or with the Forward Slash (/) 'Goto' Command described later 
  618.     on in Chapter 7.  The number between the angle brackets <>, located at 
  619.     the intersection of the Row and Column Bars, indicates the worksheet 
  620.     level of each window. 
  621.  
  622.     Formulas can be written that reference cell values from the same 
  623.     worksheet by leaving the Worksheet Level field BLANK or from 
  624.     worksheets loaded at different levels by including the Worksheet 
  625.     Level field in the Cell Address.  For example: 
  626.  
  627.         [1,2]        ==>     Addresses the cell at row 1, column 2 of
  628.                              whatever level the formula that contains
  629.                              this reference is loaded at (1 thru 4).
  630.  
  631.         [1,2,0,3]    ==>     Addresses the cell at row 1, column 2,
  632.                              worksheet 3
  633.  
  634.     Normally, it IS NOT a good idea to include the 'Worksheet Level' field 
  635.     in a Cell Address that makes a reference to a cell at the SAME level.  
  636.     First it is not necessary; and second, it can cause problems if you 
  637.     later copy the cell's formula to another level.  When this field is left 
  638.     blank or is set to zero (0), it's value will automatically be reset to 
  639.     whatever level it is loaded at!  This allows formulas that contain Cell 
  640.     Addresses to be copied to virtually any level without modifying them. 
  641.     Remember, whenever the Worksheet Level field is hardcoded (fixed), you 
  642.     are making an absolute reference to a cell at a particular level.  This 
  643.     reference will not be adjusted when the cell is copied or moved to 
  644.     another worksheet level.  For example, if a formula entered at level 1 
  645.     contains a hardcoded cell reference to another cell at level 1 (e.g. 
  646.     [2,3,,1]), it will still reference the same cell (at level 1) - even if 
  647.     the worksheet is later loaded at level 3.  So, when in doubt, do not use 
  648.     the 'Worksheet Level' field, since 99 percent of the time your formulas 
  649.     will be referencing other cells within the same worksheet. 
  650.  
  651.  
  652.     -----------------------------------------------------------------------
  653.     Section 6:7    RANGE OPERATIONS 
  654.     -----------------------------------------------------------------------
  655.  
  656.     Unlike most spreadsheets, that restrict a range to defining a block of 
  657.     cells which can be used in function calls, this spreadsheet allows a 
  658.     range to be used in much the same way as a Cell Address.  That is, a 
  659.     range (or Range Operation) IS AN EXPRESSION that returns a value - not 
  660.     just a block of cells.  What makes this possible, is the ability to 
  661.     associate one or more formulas to a whole the range of cells. Each of 
  662.     these formulas is evaluated once, except when surrounded by curly braces 
  663.     {}; in which case, the expression is evaluated once for each FORMULA 
  664.     cell that falls within it's range.  This allows you to move though a 
  665.     whole series of cells, performing a variety of operations as you go.  
  666.     The following is a diagram of how Range Operations are organized: 
  667.      
  668.  
  669.                         defines                   formulas surrounded by
  670.                         lower right               curly braces {} are
  671.                         corner ___                executed once for each
  672.            defines                |             _ cell within the range
  673.            upper left ______      |___         |
  674.            corner       |   |     |   |        |
  675.                       [row,col ^ row,col ; f; {f}; f;]
  676.                                |         | |_______|  
  677.                   required ____|         |         |____ formulas not
  678.                                          |               surrounded by
  679.                    required between _____|               {} are evaluated
  680.                    each formula                          only once
  681.  
  682.  
  683.             [  ]  -  By definition, Range Operations MUST be
  684.                      enclosed within square brackets, indicating
  685.                      they return a value.
  686.       
  687.               ^   -  The (^) symbol is a required to separate the
  688.                      cells which define the upper left and lower
  689.                      right corners of the range of cells.
  690.  
  691.               f   -  The (f) in the above diagram represents an
  692.                      expression (formula) that is evaluated once
  693.                      when it is first encountered. 
  694.  
  695.              {f}  -  Curly brackets {} act like a FOR or DO loop
  696.                      that forces the Range Operation to access the
  697.                      value of each FORMULA cell within the range
  698.                      (beginning at the upper left corner and moving
  699.                      down in a left-right direction).  The formula
  700.                      within the brackets is executed once as each cell
  701.                      is encountered.  Only one formula can be enclosed
  702.                      within each set of brackets. 
  703.  
  704.               ;   -  Each formula must be separated by a semicolon.
  705.  
  706.                 
  707.     There are also seven special 'registers' that are reserved especially 
  708.     for Range Operations.  These registers are designed to track critical 
  709.     values that may change as the expressions (associated with the Range 
  710.     Operations) are evaluated.  Each is represented by a special character 
  711.     enclosed within square brackets (i.e. [$], [#], etc..) and is described 
  712.     below. 
  713.  
  714.              [$]  -  Contains the INTERMEDIATE and FINAL results of a Range 
  715.                      Operation.  It can act as an accumulator, whenever an 
  716.                      expression is surrounded by curly braces {}, storing 
  717.                      the value produced by the expression after it is 
  718.                      evaluated once for each cell within the range.  By 
  719.                      default, this register is initialized to '0' prior to 
  720.                      evaluating any expression that is surrounded by curly 
  721.                      braces. 
  722.  
  723.              [@]  -  Whenever an expression is enclosed within curly 
  724.                      brackets {}, it will be evaluated once for every 
  725.                      FORMULA cell within the range.  The [@] register acts 
  726.                      like a variable Cell Address that contains the VALUE 
  727.                      of the cell currently being accessed by the Range 
  728.                      Operation as it moves from one cell to the next. 
  729.  
  730.              [#]  -  This register is a COUNTER.  It is initialized to one 
  731.                      (1) at the start of any expression that is surrounded 
  732.                      by curly brackets {}.  Its value is incremented by 
  733.                      one each time the Range Operation moves to the next 
  734.                      FORMULA cell. 
  735.  
  736.              [*]  -  This register has no predefined function. It can
  737.                      be used with assignment operations to hold the 
  738.                      intermediate results of any calculation.
  739.  
  740.              [-]  -  Whenever an expression is enclosed within curly 
  741.                      brackets {}, it will be evaluated once for every 
  742.                      FORMULA cell within the range.  The [-] register 
  743.                      contains the ROW number of the cell currently being 
  744.                      accessed by the Range Operation, which is the same 
  745.                      cell whose value is currently loaded in the [@]
  746.                      register. 
  747.  
  748.              [|]  -  This register contains the COLUMN number of the cell 
  749.                      currently being accessed by the Range Operation. 
  750.  
  751.              [%]  -  This register contains the WORKSHEET LEVEL number of 
  752.                      the cell currently being accessed by the Range 
  753.                      Operation. 
  754.  
  755.  
  756.             Example 1   COUNT THE CELLS WITHIN A RANGE
  757.  
  758.             Count the number of FORMULA cells within a range.  (Empty
  759.             cells and cells that contain Labels are skipped.)
  760.  
  761.                              [1,1 ^ 12,12]
  762.  
  763.                NOTE:  By default, a Range Operation that contains
  764.                no formulas will return the total number of FORMULA
  765.                cells found within the range.  A more literal way of
  766.                doing the same thing would be:
  767.      
  768.                            [1,1 ^ 12,12; [$]=[#] ]
  769.  
  770.                REMEMBER:  The result of any expression, after
  771.                it has been evaluated (in this case: [#]) will
  772.                automatically be placed in the [$] register.
  773.                As a result, the [$]=[#] assignment really isn't
  774.                necessary and the above Range Operation could have
  775.                been shortened to look like this:
  776.  
  777.                              [1,1 ^ 12,12; [#] ]
  778.  
  779.  
  780.             Example 2   SUM ALL OF THE CELLS WITHIN A RANGE
  781.  
  782.                                     ___ accumulated results
  783.                                    |
  784.                    [1,1 ^ 12,12; {[$]+[@]} ]
  785.                                        |___ value of current cell
  786.                                             being accessed
  787.  
  788.  
  789.             Example 3   SUM THE VALUES WITHIN A CELL'S ARRAY AREA
  790.  
  791.                                        ___ accumulated results
  792.                                       |
  793.                    [2,3,1 ^ 2,3,12; {[$]+[@]} ]
  794.                         |        |        |__ value in array element of
  795.                         |        |            cell being referenced
  796.                         |________|___ array element numbers
  797.  
  798.                NOTE:  Range Operations can only be performed on 
  799.                arrays if the Row, Column, and Worksheet Level
  800.                are equal.
  801.  
  802.  
  803.             Example 4   COMPUTE AVERAGE VALUE WITHIN A RANGE
  804.  
  805.                         accumulated results___
  806.                                               |
  807.                     [1,1 ^ 12,12; {[$]+[@]}; [$]/[#] ]
  808.                                                   |
  809.                                 final cell count__|
  810.  
  811.                REMEMBER:  Only FORMULA cells are visible to a
  812.                Range Operation.
  813.  
  814.                      
  815.             Example 5   RETURN THE LARGEST NUMBER  WITHIN A RANGE
  816.  
  817.             Find the largest positive number within the range bounded
  818.             by cell [10,10] in the upper left hand corner and cell
  819.             [20,20] in the lower right corner.
  820.  
  821.                    [10,10^20,20; {([@]>[$]) ?[@] :[$];} ]
  822.  
  823.  
  824.             Example 6    STANDARD DEVIATION
  825.  
  826.             Compute the Standard Deviation for a range of cells 
  827.             between [1,1] and [5,1].
  828.  
  829.                    save average ____
  830.                                     |
  831.             [1,1 ^ 5,1; {[$]+[@]}; [*]=[$]/[#]; {[$]+([@]-[*])**2};
  832.             sqrt(([$])/([#]-1))]
  833.  
  834.  
  835.             Example 7    SEARCH A RANGE FOR A VALUE
  836.  
  837.             Perform a Table Search between cells [1,1] and [5,1] for
  838.             the first value greater than 4.  If found, return the value
  839.             located one column to the right of it.  (This is similar to
  840.             the @VLOOKUP function used by many spreadsheets).
  841.  
  842.             [1,1 ^ 5,1; {[*] = ([@]>4) ?[[-],[|]+1] :[*];}; [$]=[*]]
  843.  
  844.                                                               
  845.     -----------------------------------------------------------------------
  846.     Section 6:8    DIRECT CELL ADDRESSES
  847.     -----------------------------------------------------------------------
  848.  
  849.     A Cell Address (i.e. [Row,Col,Element,Level]) makes a 'direct' cell 
  850.     reference to the value in another cell when:  NONE OF THE FIELDS USED 
  851.     WITHIN THE CELL ADDRESS ARE VARIABLE.  That is, when the specific cell 
  852.     that is being referenced by a Cell Address (within a formula) can 
  853.     never be changed as the result of an update made somewhere else in the 
  854.     spreadsheet, it is termed a 'direct' cell reference.  For example, 
  855.     "[1,2]" makes a direct cell reference to the cell at row 1 column 2, 
  856.     since it's Row or Column fields can not vary.  Direct cell references 
  857.     have one very important property - THEY CAUSE THE FORMULAS THAT 
  858.     CONTAIN THEM TO BE RECOMPUTED WHENEVER THE VALUE OF THE CELL BEING 
  859.     ADDRESSED IS CHANGED.  This is opposed to expressions that contain 
  860.     'indirect' cell references (see Section 6:9), which are not recomputed 
  861.     under similar circumstances. 
  862.  
  863.  
  864.     -----------------------------------------------------------------------
  865.     Section 6:9    INDIRECT CELL ADDRESSES
  866.     -----------------------------------------------------------------------
  867.  
  868.     Because the 'Row', 'Column', 'Array', and 'Worksheet' fields are 
  869.     themselves expressions, their values can be designed to vary based on 
  870.     a change made to the spreadsheet.  When this condition exists, it has 
  871.     the affect of changing the actual cell being addressed!  This is called 
  872.     'indirect' cell addressing, and it can be quite useful at times.  Say, 
  873.     for example, cell [1,1] contains the value 10 and cell [2,2] contains 
  874.     the value 20.  A Cell Address can now be written that uses the values in 
  875.     both of these cells as its 'row' and 'column' number fields; thereby 
  876.     referencing cell [10,20] - INDIRECTLY!   In other words, the cell that 
  877.     is actually being addressed depends on the contents of cells [1,1] and 
  878.     [2,2].  It might look something like this: 
  879.  
  880.                                __________________ Indirect Reference
  881.                               |               |     to cell [10,20]
  882.                    
  883.                               [ [1,1] , [2,2] ]
  884.        The ROW is the value       |       |     The COLUMN is the 
  885.        value in cell [1,1]________|       |____ value in cell [2,2]
  886.  
  887.  
  888.            NOTE:  In the above example, the references to cells
  889.            [1,1] and [2,2] are both 'direct' cell references.
  890.  
  891.      
  892.     Notice that as the values in cells [1,1] and/or [2,2] change, the 
  893.     'address' of the cell being referenced by the above expression will 
  894.     also change.  This can be a very powerful means of accessing values 
  895.     within tables, depending on the results of other calculations.  There 
  896.     is, however, one significant trade off you must make when using 
  897.     'indirect' cell references: 
  898.  
  899.          A FORMULA THAT CONTAINS AN 'INDIRECT' REFERENCE TO A CELL,
  900.          WILL NOT BE RECALCULATED WHEN THE VALUE OF THAT CELL IS
  901.          CHANGED.
  902.  
  903.     The only way to get around this particular drawback is to set a flag 
  904.     that will FORCE the cell, containing the reference, to be recalculated 
  905.     each time ANY change is made to the spreadsheet (see Section 6:11 -  
  906.     Forced Recalculations). 
  907.                 
  908.   
  909.  
  910.     -----------------------------------------------------------------------
  911.     Section 6:10   WHEN DO FORMULAS GET RECALCULATED ?
  912.     -----------------------------------------------------------------------
  913.  
  914.     Sometimes it's difficult to tell which cells will be affected, when a 
  915.     change is made to the worksheet.  If you're having trouble with this, 
  916.     try to remember the following rules: 
  917.      
  918.          A DIRECT CELL REFERENCE, within a formula, will cause THAT
  919.          formula to be recalculated each time the value of the cell
  920.          (being referenced) is changed.
  921.  
  922.          ALL formulas that contain Range Operations are recomputed at
  923.          least once - each time a change is made to the worksheet 
  924.          (unless the 'dRange' value is set to zero - see Section 4:8).
  925.  
  926.     The F8 (Affect) function key command can also be used to locate the
  927.     cells that make 'direct' references to other cells (see Section 4:7).
  928.     This is done by placing the Cell Pointer over the cell in question and
  929.     executing the command from the Input Line.  You will then be shown all
  930.     of the cells that reference it.  These are the cells that will cause
  931.     the formula to be recomputed if their values change. You will be also
  932.     shown the cells that USE the value of the cell in question. 
  933.  
  934.            
  935.     -----------------------------------------------------------------------
  936.     Section 6:11   FORCING CELLS TO RECALCULATE
  937.     -----------------------------------------------------------------------
  938.  
  939.     Occasionally, you may run into a case were a cell's formula is not 
  940.     recalculate when the value of one of the cells that it references is 
  941.     changed.  For example, if a cell makes an INDIRECT CELL REFERENCE to 
  942.     another cell, its formula will NOT be recomputed when the value of 
  943.     this (indirectly) referenced cell is changed.  When it is absolutely 
  944.     necessary that a cell's value reflect such changes, a special flag can 
  945.     be set that will FORCE the cell's formula to be recalculated whenever 
  946.     ANY change is made to the spreadsheet.  Section 4:1 "+ReCalc" describes 
  947.     how to do this by setting up and executing the following command:  
  948.     "+ReCalc  Cell  OKAY?".  This flag should be used sparingly, however, as 
  949.     it defeats the "Minimal Re-Calc" capabilities of the spreadsheet.  It is 
  950.     also up to you to keep track of the cells that have had their 'ReCalc' 
  951.     flag set. 
  952.     
  953.  
  954.     -----------------------------------------------------------------------
  955.     Section 6:12    OPTIMIZING YOUR WORKSHEET
  956.     -----------------------------------------------------------------------
  957.     
  958.     Generally speaking, there are several things you can do to optimize 
  959.     your worksheet:  1) PREVENT complex formulas from being recomputed 
  960.     until their results are needed by setting the "+NoCalc" flag (see 
  961.     Section 4:1);  2) LIMIT the number of 'indirect' cell references - 
  962.     'direct' cell references are faster;  3) KEEP the 'dRange' default 
  963.     setting set to 1 (refer to Section 4:8) to reduce the number of times 
  964.     a formula that contains a recursive Range Operation will be 
  965.     recalculate. 
  966.     
  967.     If a cell contains a complicated formula that takes a long time to re-
  968.     calculate, you can speed up the spreadsheet by blocking the calculation 
  969.     until you the specifically request that it be made.  Section 4:1 
  970.     describes how to do this by setting up and executing the following 
  971.     command:  "+NoCalc  Cell  OKAY?".  It's up to you, however, to remember 
  972.     when and where you have used this flag on a cell! 
  973.  
  974.     To minimize the number of calculations that must be performed after a 
  975.     change has been made to the spreadsheet, REBEL will only re-compute 
  976.     the cells that are affected by the change.  This is often referred to 
  977.     as "minimal recalc".  There are, however, certain cases in which this 
  978.     strategy can be more of a disadvantage than an advantage.  Take, for 
  979.     example, cell [25,25] whose formula contains a 'Range Operation' that 
  980.     sums all of the cells bounded by cell [1,1] (in the upper left corner) 
  981.     and cell [20,20] (in the lower left corner).  The expression might look 
  982.     something like this:  [1,1 ^ 20,20; {[$]+[@]}].  Here's the problem. 
  983.     Lets say that the value of EACH cell within this range is affected by a 
  984.     change made to cell [45,45] (i.e. all cells within this range make a 
  985.     'direct' reference to cell [45,45]).  Now, imagine the following 
  986.     scenario.  Suppose you change the value in cell [45,45]. What happens?   
  987.     Each of the cells within the range will be recomputed; AND EACH TIME A 
  988.     CHANGE IS MADE TO A ONE OF THESE CELLS IT WILL TRIGGER THE CELL THAT 
  989.     CONTAINS THE 'RANGE OPERATION' TO BE RECOMPUTED - cell [25,25].  As a 
  990.     result, cell [25,25] will be needlessly recomputed 400 times (once for 
  991.     each cell in the range); when, in reality, the Range Operation only 
  992.     needed to be recomputed once, after the last cell in the range was 
  993.     updated.  This, of course, is a worst case and is easily handled with a 
  994.     special setting that can limit the number of times a Range Operation can 
  995.     be be recalculated as the result of a single change made to the 
  996.     worksheet (see Section 4:8 - "dRange"). 
  997.       
  998.     Another type of Range Operation that can cause problems is one that is
  999.     included WITHIN ITS OWN RANGE!  That is, a Range Operation that makes a
  1000.     circular reference to itself, causing the cell's formula to be
  1001.     recalculated - indefinitely.  Once again, the "dRange" setting can be 
  1002.     used to control this situation. 
  1003.  
  1004.  
  1005.     -----------------------------------------------------------------------
  1006.     Section 6:13   MISCELLANEOUS TOPICS
  1007.     -----------------------------------------------------------------------
  1008.  
  1009.  
  1010.     6:13:1  ENTERING NUMBERS FROM THE INPUT LINE
  1011.  
  1012.     Numeric values can be entered from the Input Line in several different 
  1013.     ways.  For example: 
  1014.  
  1015.         1)  Standard decimal values can be entered simply by typing
  1016.             them as they appear:
  1017.  
  1018.                          0    ===>   0
  1019.                       25.4    ===>   25.4
  1020.                         40    ===>   40
  1021.                        040    ===>   32  (CAUTION!  do not precede a
  1022.                                           decimal value with a '0',
  1023.                                           unless the number is zero.)
  1024.     
  1025.         2)  Octal numbers can be entered by beginning them with a zero:
  1026.  
  1027.                        040  ==(octal equivalent)==>   32
  1028.                       0377  ==(octal equivalent)==>   255
  1029.  
  1030.         3)  Hexadecimal numbers can be entered by preceding them with a
  1031.             "0x":
  1032.                       0xFF  ===(hex equivalent)===>   255
  1033.  
  1034.         4)  The numeric value of any ASCII character can be entered by
  1035.             enclosing the character within single quotes.  Note, if the
  1036.             single quote is the first character in the expression, be
  1037.             sure the precede it with a plus sign (+'A').  This will
  1038.             prevent the expression from being interpreted as a LABEL.
  1039.  
  1040.                        'A'  ==(ascii equivalent)==>   65
  1041.                        'B'  ==(ascii equivalent)==>   66
  1042.                        '!'  ==(ascii equivalent)==>   33
  1043.  
  1044.  
  1045.       IMPORTANT!  To avoid confusion, remember to NEVER being a decimal
  1046.       number with a zero  (unless, of course, the number is zero)!
  1047.  
  1048.  
  1049.     6:13:2   SWITCHES 
  1050.  
  1051.     Several switches can be used when starting up REBEL:  
  1052.        
  1053.         1)  The -S switch can be used to create a backup file, whenever
  1054.             a worksheet is load.  This file will be an exact copy of
  1055.             the original worksheet, but will have a .RB0 extension.
  1056.             (You will have to rename it to a .RB0 file before you can
  1057.             use it.)
  1058.  
  1059.         2)  The -B switch can be used to startup REBEL in black and white
  1060.             mode; otherwise, the program will be be started in the color
  1061.             mode.
  1062.  
  1063.         3)  The -L: option is used to 'attach' a script library to the
  1064.             current session.  The -L: switch should be followed
  1065.             immediately by the name of the library file (no blanks).
  1066.             Also refer to Section 11:2.
  1067.  
  1068.                               REBEL  -L:STDLIB
  1069.  
  1070.         4)  The -M: option is used to set the size of the Swap Area used
  1071.             by the Script Manager.  The -M: switch should be followed
  1072.             immediately by the size (in bytes).  Refer to Section 11:4.
  1073.  
  1074.                            REBEL  -L:STDLIB  -M:2000
  1075.  
  1076.         5)  The -X: option is used to executed a script immediately upon
  1077.             entering the spreadsheet.  This option is useful when it's
  1078.             important to hide the spreadsheet and it's data from the user.
  1079.             The option is used by following the -X: portion of the switch
  1080.             immediately with the name of the script you wish to execute.
  1081.             Remember, you must also use the -L: option to attach the 
  1082.             library that contains the script when using this option.
  1083.  
  1084.                            REBEL  -L:MYLIB  -X:scriptname
  1085.  
  1086.  
  1087.  
  1088.     6:13:3   WILDCARD CHARACTERS
  1089.  
  1090.     The tilde (~) character is reserved by REBEL as a wildcard character.  
  1091.     As a result, it can not be used within a label. (Refer to the 'Search' 
  1092.     command in the next Chapter, and the 'Load' and 'ListDir' commands 
  1093.     described in Section 4:3 for examples of how the tilde character is 
  1094.     uses.) 
  1095.  
  1096.  
  1097.                                                   ________________________
  1098.     _____________________________________________/  Chapter 7   SHORTCUTS 
  1099.  
  1100.  
  1101.  
  1102.     The following 'Shortcut' commands are designed to be executed from the 
  1103.     Input Line (below the Function Key Menu).  They do not perform critical 
  1104.     tasks; although, you may find them useful time savers.  Each of these 
  1105.     commands (with the exception of the <Tab> Command) must be followed by 
  1106.     the <Enter> key before it is executed. 
  1107.  
  1108.     NOTE!  Because the backslash (\), period (.), and equal sign (=) are 
  1109.     used to trigger Shortcut Commands, you CANNOT begin a LABEL with one of 
  1110.     these characters without first preceding it with a single quote ('). 
  1111.  
  1112.  
  1113.  
  1114.     7:1   CHANGE WINDOWS    <Tab>
  1115.         
  1116.     Pressing the <Tab> key at the Input Line prompt, will cause the Cell 
  1117.     Pointer to jump to another window (if one exists). 
  1118.  
  1119.  
  1120.  
  1121.     7:2   SEARCH    (\)
  1122.         
  1123.     A backslash (\) followed by any pattern of characters will cause the 
  1124.     Cell Pointer to move to the first cell the contains an occurrence of 
  1125.     that pattern. If the Cell Pointer is positioned on an 'empty' cell, the 
  1126.     search will begin at the top of the worksheet.  If the Cell Pointer is 
  1127.     positioned on an 'occupied' cell, the search will begin from that 
  1128.     point. The pattern does not have to be re-entered to make repeated 
  1129.     searches. Simply type a backslash (\) followed by the <Enter> key after 
  1130.     you have entered the pattern the first time. The wildcard character (~) 
  1131.     can also be included within the search pattern. 
  1132.  
  1133.  
  1134.  
  1135.     7:3  GOTO CELL   (/)
  1136.         
  1137.     A Forward Slash (/) will produce a series of prompts that will request 
  1138.     the Row, Column, and Worksheet Level to move the Cell Pointer to.  The 
  1139.     value in the square brackets [] of each of these prompts is the default 
  1140.     answer that will be used if you press the <Enter> key with no other 
  1141.     input. This command can also be used with prompts that require you to 
  1142.     move the Cell Pointer to define a Range or Target cell. 
  1143.  
  1144.  
  1145.  
  1146.     7:4   ELEMENT DISPLAY   (=)
  1147.         
  1148.     An Equal Sign (=) followed by an array element number (e.g. =5) can be 
  1149.     used to display the value of any array position of the cell highlighted 
  1150.     by the Cell Pointer.  The display appears at the Input Line and can be 
  1151.     removed by pressing any key.  For example, "=1" will display the value 
  1152.     of the first array element. Note: "=0" will always return the value 
  1153.     associated with the cell's formula.  The following variations of this 
  1154.     command are also acceptable: 
  1155.  
  1156.              =*       Displays all of the values stored in a 
  1157.                       cell's array area - one at a time. 
  1158.                         
  1159.              =        The equal sign (alone), works like the "=*' 
  1160.                       variation, except when displaying the 
  1161.                       contents of cells that contain coordinates 
  1162.                       or matrices.  In these case, coordinate 
  1163.                       pairs and matrix rows are displayed 
  1164.                       together (if possible).i 
  1165.  
  1166.  
  1167.            =(5,9)     Displays elements 5 thru 9
  1168.  
  1169.  
  1170.  
  1171.     7:5   SET ELEMENT   (=e<#)
  1172.         
  1173.     An Equal sign (=) followed by an array element number (greater than 0), 
  1174.     then a Less Than sign (<), and finally a value will cause that value 
  1175.     (to the right of the '<' sign) to be loaded at the designated array 
  1176.     position.  For example, "=7<25" will load the value 25 into element 
  1177.     position 7 of the cell that is highlighted by the Cell Pointer.  The 
  1178.     following variations of this command may also be used: 
  1179.  
  1180.             =*<0      Set the values of all elements to 0
  1181.  
  1182.         =(5,9)<0      Set elements 5 thru 9 to 0
  1183.  
  1184.  
  1185.  
  1186.     7:6   CELL RECALC    (.)
  1187.         
  1188.     The formula of any cell can be quickly RECALCULATED by positioning the 
  1189.     Cell Pointer over the cell and entering a Dot (.) followed by the 
  1190.     <Enter> key. 
  1191.  
  1192.  
  1193.  
  1194.                                                   ________________________
  1195.     _____________________________________________/  Chapter 8    FUNCTIONS 
  1196.  
  1197.  
  1198.  
  1199.  
  1200.          IMPORTANT:  All of the functions listed in this Chapter are
  1201.          case sensitive (i.e. spell them just as they appear - in most
  1202.          cases, with lower case letters).  In addition, remember to use
  1203.          a '+' sign whenever a function begins a formula.  This will
  1204.          insure that the cell is interpreted as a FORMULA rather than
  1205.          a LABEL.
  1206.  
  1207.  
  1208.  
  1209.                               Index to Functions
  1210.  
  1211.             abs(x) . . . . . . 8:1:1  MATH . . . . . . absolute value
  1212.             acos(x)  . . . . . 8:2:5  TRIG . . . . . . arccosine 
  1213.             asin(x)  . . . . . 8:2:6  TRIG . . . . . . arcsine
  1214.             atan(x)    . . . . 8:2:7  TRIG . . . . . . arctangent
  1215.             atan2(x,y) . . . . 8:2:8  TRIG . . . . . . arctangent
  1216.             atof       . . . . 8:3:1  STRING . . . . . string to number
  1217.             ceil(x)    . . . . 8:1:2  MATH . . . . . . ceiling
  1218.             col(x)     . . . . 8:4:1  MISC . . . . . . column-offset
  1219.             cos(x)     . . . . 8:2:1  TRIG . . . . . . cosine
  1220.             cotan(x)   . . . . 8:2:2  TRIG . . . . . . cotangent
  1221.             exp        . . . . 8:1:3  MATH . . . . . . exponential
  1222.             floor      . . . . 8:1:4  MATH . . . . . . floor
  1223.             frac       . . . . 8:1:5  MATH . . . . . . fractional value
  1224.             index      . . . . 8:3:2  STRING . . . . . locate character
  1225.             int        . . . . 8:1:6  MATH . . . . . . integer value
  1226.             log10      . . . . 8:1:7  MATH . . . . . . base 10 log
  1227.             ln         . . . . 8:1:8  MATH . . . . . . natural log
  1228.             lvl        . . . . 8:4:3  MISC . . . . . . worksheet level offset
  1229.             mode       . . . . 8:1:9  MATH . . . . . . change mode of angle
  1230.             rnd        . . . . 8:1:10 MATH . . . . . . rounds value
  1231.             row        . . . . 8:4:2  MISC . . . . . . row offset
  1232.             sin        . . . . 8:2:3  TRIG . . . . . . sine
  1233.             sqrt       . . . . 8:1:11 MATH . . . . . . square root
  1234.             strcat     . . . . 8:3:3  STRING . . . . . string concatenate
  1235.             strcmp     . . . . 8:3:5  STRING . . . . . string compare
  1236.             strcpy     . . . . 8:3:7  STRING . . . . . string copy
  1237.             strlen     . . . . 8:3:9  STRING . . . . . string length
  1238.             strncat    . . . . 8:3:4  STRING . . . . . concatenate n chars
  1239.             strncmp    . . . . 8:3:6  STRING . . . . . compare n chars
  1240.             strncpy    . . . . 8:3:8  STRING . . . . . copy n chars
  1241.             tan        . . . . 8:2:4  TRIG . . . . . . tangent
  1242.  
  1243.  
  1244.  
  1245.          NOTE:  Refer to Chapters 9 and 10 for a decription of the 
  1246.          Coordinate Geometry (COGO) and Matrix functions.  Also see file 
  1247.          STDLIB.DOC for a description of the scripts in the Standard Script 
  1248.          Library. 
  1249.  
  1250.  
  1251.  
  1252.     -----------------------------------------------------------------------
  1253.     Section 8:1:0  MATH FUNCTIONS
  1254.     -----------------------------------------------------------------------
  1255.  
  1256.  
  1257.     8:1:1   abs (x)
  1258.      
  1259.                 Returns the absolute value of any expression 'x'.
  1260.  
  1261.     8:1:2   ceil (x)
  1262.      
  1263.                 Returns the smallest integral value that is greater than or
  1264.                 equal to the value produced by expression 'x'.
  1265.  
  1266.     8:1:3   exp (x)
  1267.      
  1268.                 Returns the exponential function of any expression 'x'.
  1269.  
  1270.     8:1:4   floor (x)
  1271.      
  1272.                 Returns the largest integral value that is less than or
  1273.                 equal to the value produced by expression 'x'.
  1274.  
  1275.     8:1:5   frac (x)
  1276.  
  1277.                 Returns the fraction part of 'x'.
  1278.  
  1279.     8:1:6   int (x)
  1280.  
  1281.                 Returns the integer part of 'x'.
  1282.  
  1283.     8:1:7   ln (x)
  1284.      
  1285.                 Returns the natural logarithm of any expression 'x'.
  1286.                 An error is returned for values of 'x' that are less than
  1287.                 or equal to 0.
  1288.  
  1289.     8:1:8   log10 (x)
  1290.      
  1291.                 Returns the logarithm to the base 10 of any expression 'x'.
  1292.                 An error is returned for values of 'x' that are less than
  1293.                 or equal to 0.
  1294.  
  1295.     8:1:9   mode (frommode,tomode,angle)
  1296.  
  1297.                 Changes the mode of 'angle' to another mode.  The mode
  1298.                 settings are:  0=radians, 1=decimal degrees, 2=grads, and
  1299.                 3=degrees/minutes/seconds (DDD.MMSSss).  The 'frommode'
  1300.                 parameter is setting to the current mode of the angle
  1301.                 and the 'tomode' parameter is set to the return mode.
  1302.  
  1303.                 Example:    +mode(1,3,90.50)  =   90.3000  
  1304.  
  1305.     8:1:10  rnd (x,n)
  1306.  
  1307.                 Rounds 'x' to 'n' decimal places, where 'n' can range
  1308.                 between 15 and -15.  If 'n' is negative, it rounds to
  1309.                 the n-th power of 10  (e.g. round(1891,-2) = 1900).
  1310.  
  1311.     8:1:11  sqrt (x)  =  square_root
  1312.      
  1313.                 Returns the square root of any expression 'x'.  An error
  1314.                 is returned for values of 'x' that are less than 0.
  1315.  
  1316.  
  1317.  
  1318.     -----------------------------------------------------------------------
  1319.     Section 8:2:0   TRIG FUNCTIONS
  1320.     -----------------------------------------------------------------------
  1321.  
  1322.  
  1323.     8:2:1   cos (angle)   = cos          OPTIONAL FORM:   cos (angle,mode)
  1324.  
  1325.     8:2:2   cotan (angle) = cotan        OPTIONAL FORM:   cotan (angle,mode)
  1326.  
  1327.     8:2:3   sin (angle)   = sin          OPTIONAL FORM:   sin (angle,mode)
  1328.  
  1329.     8:2:4   tan (angle)   = tan          OPTIONAL FORM:   tan (angle,mode)
  1330.  
  1331.                 Returns the sin, cos, tan, or cotan of any 'angle' in
  1332.                 radians.  Angles in degrees and grads can also be used by
  1333.                 including the optional 'mode' parameter, where 0=RADIANS
  1334.                 (default), 1=DEGREES, and 2=GRADS.
  1335.  
  1336.  
  1337.     8:2:5   acos (cos)  =  angle           OPTIONAL FORM:   acos (cos,mode)
  1338.  
  1339.     8:2:6   asin (sin)  =  angle           OPTIONAL FORM:   asin (sin,mode)
  1340.  
  1341.     8:2:7   atan (tan)  =  angle           OPTIONAL FORM:   atan (tan,mode)
  1342.  
  1343.     8:2:8   atan2 (x,y)  =  angle          OPTIONAL FORM:   atan2 (x,y,mode)
  1344.  
  1345.                 Returns the arc sin, arc cos or arc tan in radians.  Angles
  1346.                 can also be returned in degrees and grads by including the
  1347.                 optional 'mode' parameter, where 0=RADIANS (default),
  1348.                 1=DEGREES, and 2=GRADS.
  1349.      
  1350.  
  1351.      
  1352.     -----------------------------------------------------------------------
  1353.     Section 8:3:0   STRING FUNCTIONS
  1354.     -----------------------------------------------------------------------
  1355.  
  1356.  
  1357.     8:3:1   atof (label)  =  value
  1358.  
  1359.                 Converts a character string (label) to it numeric
  1360.                 equivalent.
  1361.  
  1362.                     Examples:     atof ("123.55")  =  123.55
  1363.  
  1364.     8:3:2   index (label,c)  =  pos      OPTIONAL FORM: index(label,c,start) 
  1365.      
  1366.                 Returns the 'position' of the first occurrence of a
  1367.                 character 'c' in a 'label'.  The search can be optionally
  1368.                 started from any location by including that location in
  1369.                 the optional 3rd parameter.
  1370.      
  1371.                  Examples:     index ("Hello World!",'o')  =  5
  1372.                                index ([1,1],'o',6)  =  8
  1373.           
  1374.     8:3:3   strcat (cell,label)   =   errorcode
  1375.      
  1376.                 Appends the contents of a 'label' or a 'string' to another
  1377.                 'cell'.  Returns '0' if successful.  Note, this function
  1378.                 WILL NOT cause other cells to be recalculated as a result
  1379.                 of any change to the cell in the first parameter.
  1380.      
  1381.                     Examples:     strcat([1,1],"Hello World!")
  1382.                                   strcat([1,1],[1,3])
  1383.  
  1384.     8:3:4   strncat (cell,string,n)   =   errorcode
  1385.      
  1386.                 Appends the first 'n' characters from a 'string' to the
  1387.                 label of to another 'cell'.  Returns '0' if successful.
  1388.                 Note, this function WILL NOT cause other cells to be
  1389.                 recalculated as a result of any change to the cell in
  1390.                 the first parameter.
  1391.      
  1392.                     Examples:     strncat([1,1],"Hello World!",5)
  1393.                                   strcat([1,1],[1,3],5)
  1394.  
  1395.  
  1396.     8:3:5   strcmp (label1,label2)   =   status
  1397.      
  1398.                 Compares 'label1' and 'label2', returning:
  1399.                     (1)  if 'label1' is GREATER than 'label2'
  1400.                     (0)  if 'label1' is EQUAL to 'label2'
  1401.                     (-1) if 'label1' is LESS the 'label2'
  1402.      
  1403.                     Examples:     strcmp ([1,1],"Hello World!")
  1404.                                   strcmp ([1,1],[1,3])
  1405.  
  1406.     8:3:6   strncmp (label1,label2,n)   =   status
  1407.      
  1408.                 Compares the first 'n' characters of 'label1' and 'label2',
  1409.                 returning:
  1410.                     (1)  if 'label1' is GREATER than 'label2'
  1411.                     (0)  if 'label1' is EQUAL to 'label2'
  1412.                     (-1) if 'label1' is LESS the 'label2'
  1413.      
  1414.                     Examples:     strncmp ([1,1],"Hello World!",5)
  1415.                                   strncmp ([1,1],[1,3],5)
  1416.           
  1417.     8:3:7   strcpy (cell,string)   =   errorcode
  1418.      
  1419.                 Copies the contents of a cell or of a 'string' to another
  1420.                 'cell'.  Returns '0' if successful.  Note, this function
  1421.                 WILL NOT cause other cells to be recalculated as a result
  1422.                 of any change to the cell in the first parameter.
  1423.      
  1424.                     Examples:     strcpy ([1,1],"Hello World!")
  1425.                                   strcpy ([1,1],[1,3])
  1426.  
  1427.     8:3:8   strncpy (cell,string,n)   =   errorcode
  1428.      
  1429.                 Copies the first 'n' characters of a 'string' to another
  1430.                 'cell'.  Returns '0' if successful.  Note, this this
  1431.                 function WILL NOT cause other cells to be recalculated as
  1432.                 a result of any change to the cell in the first parameter.
  1433.      
  1434.                     Examples:     strncpy ([1,1],"Hello World!",5)
  1435.                                   strncpy ([1,1],[1,3],5)
  1436.  
  1437.     8:3:9   strlen (label)  =  number_of_characters
  1438.      
  1439.                 Returns the number of characters in a label (string).
  1440.      
  1441.                     Examples:     strlen ("Hello World!")
  1442.                                   strlen ([1,1])
  1443.      
  1444.      
  1445.     -----------------------------------------------------------------------
  1446.     Section 8:4:0   MISC FUNCTIONS
  1447.     -----------------------------------------------------------------------
  1448.      
  1449.     8:4:1   col (offset)
  1450.  
  1451.                  Adds the 'offset' value to the COLUMN number of the cell
  1452.                  that contains the 'formula' that this function is used in.
  1453.  
  1454.                     Examples:     25.0 + [6,col(2)]
  1455.  
  1456.     8:4:2   row (offset)
  1457.  
  1458.                  Adds the 'offset' value to the ROW number of the cell
  1459.                  that contains the 'formula' that this function is used in.
  1460.  
  1461.                     Examples:     25.0 + [row(-1),col(2)]
  1462.  
  1463.     8:4:3   lvl (offset)
  1464.  
  1465.                  Adds the 'offset' value to the LEVEL number of the cell
  1466.                  that contains the 'formula' that this function is used in.
  1467.  
  1468.                     Examples:     25.0 + [6,5,,lvl(1)]
  1469.  
  1470.  
  1471.                                              _____________________________
  1472.     ________________________________________/  Chapter 9     COGO
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.                                Index of Functions     
  1480.  
  1481.  
  1482.  
  1483.        @XY . . . . . .  (load [x,y] rec coordinate)  . . . . . . . . 9:3:1
  1484.        @NE . . . . . .  (load [north,east] rec coordinate) . . . . . 9:3:2
  1485.        @POLAR. . . . .  (load polar coordinate (radius,ray)) . . . . 9:3:3
  1486.        @Traverse . . .  (bearing/azimuth traverse) . . . . . . . . . 9:3:4
  1487.        @FieldAngle . .  (field angle traverse) . . . . . . . . . . . 9:3:5
  1488.        @AngAngInt  . .  (angle/angle intersection) . . . . . . . . . 9:3:6
  1489.        @AngDstInt  . .  (angle/distance intersection). . . . . . . . 9:3:7
  1490.        @DstDstInt  . .  (distance/distance intersection) . . . . . . 9:3:8
  1491.        @CurveRadius  .  (horizontal curve with radius) . . . . . . . 9:3:9
  1492.        @CurveDelta . .  (horizontal curve with delta angle). . . . . 9:3:10
  1493.        @Segment  . . .  (line segment) . . . . . . . . . . . . . . . 9:4:1
  1494.        @Polygon  . . .  (closed polygon/traverse). . . . . . . . . . 9:4:2
  1495.        @Inverse  . . .  (inverse traverse) . . . . . . . . . . . . . 9:5:1
  1496.        @Radial . . . .  (radial stakeout). . . . . . . . . . . . . . 9:5:2
  1497.        @Closure  . . .  (error of closure/area of POLYGON) . . . . . 9:5:3
  1498.        @Triangle . . .  (triangle solution). . . . . . . . . . . . . 9:6:1
  1499.  
  1500.  
  1501.  
  1502.  
  1503.     ------------------------------------------------------------------------
  1504.     Section 9:1    ABOUT THIS PACKAGE
  1505.     ------------------------------------------------------------------------
  1506.  
  1507.     While this package is easy to use, it does take advantage of several of 
  1508.     REBEL's more advanced features.  As a result, it is NOT advisable to 
  1509.     jump immediately into these functions without first reviewing the 
  1510.     preceding chapters. I highly recommend, that at a very minimum, you 
  1511.     become familiar with the concept of "Cell Array Areas" (discussed in 
  1512.     Section 6:5) before continuing. 
  1513.  
  1514.     In general, you'll find that most of the functions described in this 
  1515.     chapter work alike, which makes them easy to learn. There are, however, 
  1516.     a few important differences that distinguish these functions from the 
  1517.     ones you have been exposed to thus far.  The most significant of these 
  1518.     differences is the way in which values are returned.  Up to now, 
  1519.     functions and expressions have always returned a single value which is 
  1520.     displayed by the cell.  Coordinate Geometry functions, on the other 
  1521.     hand, return (and sometimes display) multiple values, such as a 
  1522.     coordinate pair.  The '@' symbol that precedes the name of each of these 
  1523.     functions is designed to help remind you of this fact.  For most 
  1524.     spreadsheets, dealing with complex numbers such as this presents a major 
  1525.     problem, since they are only capable of storing a single value in each 
  1526.     cell.  This is not a limitation for REBEL, however, which can 
  1527.     dynamically create and load upto 8000 values in the "array area" of a 
  1528.     cell.  Before attempting to use these functions, there are a few 
  1529.     additional facts you should be aware of. 
  1530.  
  1531.     FIRST, as just mentioned, all '@' functions return multiple values, 
  1532.     which are automatically loaded into the cell's array area for you. It is 
  1533.     important to remember that before a cell can be recognized by other 
  1534.     functions as containing one of these multiple value solutions (such as a 
  1535.     coordinate pair), the cell MUST have been created with an '@' function.  
  1536.     In other words, if you want to enter a known or fixed coordinate pair, 
  1537.     you must use either the @XY, @NE, or @POLAR function to do it.  You can 
  1538.     not create the cell yourself simply by defining and loading an array 
  1539.     area.  Null Points, Segments, and Polygons (discussed in Section 9:7) 
  1540.     are the one exception to these rule. 
  1541.     
  1542.     SECOND, no '@' function can be nested within the parameter list of 
  1543.     another function or used within an expression.  These functions must be 
  1544.     the lone entry in a cell's formula. 
  1545.  
  1546.     THIRD, '@' functions rarely display the value stored at element position 
  1547.     [0], which is normally the case with expressions and standard functions 
  1548.     that return single values.  Instead, the '@' functions typically display 
  1549.     one or more of the values stored in the cell's ARRAY AREA, such as a 
  1550.     coordinate pair or an anlge and distance.  As a result, the Column Width 
  1551.     must be set wide enough to display multiple values - to prevent an 
  1552.     overflow.  If this condition (an overflow) should occur, a series of 
  1553.     stars (*****) will be displayed by the cell.  To correct it, simply 
  1554.     increase the Column Width until the correct values appear (refer to the 
  1555.     'Width' Menu option in Section 4:6). 
  1556.  
  1557.     FOURTH, many '@' functions return valuable secondary information that 
  1558.     is not displayed.  These values, which are also stored in the cell's 
  1559.     array area, are defined at the end of each function description and may 
  1560.     be inspected using the "=*" Element Display command discussed in Chapter 
  1561.     7. 
  1562.  
  1563.  
  1564.  
  1565.                                   SUMMARY
  1566.  
  1567.     1)  YOU CAN NOT CREATE A 'POINT', 'SEGMENT', OR 'POLYGON' CELL WITHOUT
  1568.         USING AN '@' FUNCTION TO DO IT.  That is, simply loading the array 
  1569.         area of a standard FORMULA cell with the correct values will not 
  1570.         work (refer to Section 9:7 for the one exception to this rule).
  1571.  
  1572.     2)  AN '@' FUNCTION CAN NOT BE NESTED (USED AS A PARAMETER) OR USED 
  1573.         WITHIN AN EXPRESSION - THEY MUST STAND ALONE. 
  1574.     
  1575.     3)  IF THE WIDTH OF A CELL IS NOT SUFFICIENT TO DISPLAY THE RESULTS OF 
  1576.         A '@' FUNCTION, A SERIES OF STARS (****) WILL BE DISPLAYED,
  1577.         INDICATING A DISPLAY OVERFLOW. 
  1578.               
  1579.     4)  ALL FUNCTIONS SHOULD BE ENTERED EXACTLY AS THEY APPEAR IN THIS 
  1580.         MANUAL.  FUNCTION NAMES ARE CASE SENSITIVE.  For example,
  1581.         "@Traverse" should NOT be entered as: "@traverse" or "@TRAVERSE". 
  1582.  
  1583.  
  1584.  
  1585.     ------------------------------------------------------------------------
  1586.     Section 9:2    PARAMETERS
  1587.     ------------------------------------------------------------------------
  1588.  
  1589.     The functions used in this package contains parameters that allow them 
  1590.     to be customized to fit your particular needs.  For example, if you 
  1591.     prefer to work in degrees as opposed to radians, you can do it by 
  1592.     setting the appropriate parameter value.  Since many of the functions 
  1593.     require the same parameter entries, learning them is easy once you get 
  1594.     started.  To keep from repeating myself a dozen times, however, I have 
  1595.     decided to explain the parameters that are common to more than one 
  1596.     function only once in the next five sections (Sections 9:2:1 thru 
  1597.     9:2:5).  At first, you may feel somewhat overwhelmed by the number of 
  1598.     options that are available.  I have tried to balance the power and 
  1599.     flexibility that these parameters provide with the ease-of-use of the 
  1600.     functions in general - without sacrificing to much in the process.  I 
  1601.     realize there is often a fine line between these objectives (I only 
  1602.     hope I have succeeded in maintaining a balance).  It may help to mark 
  1603.     the specific options you are interested in as you read through each 
  1604.     section, which are really the only ones you need to remember.  The 
  1605.     remaining options can be ignored until you need them.  The following 
  1606.     diagram provides an example of each parameter type and the section 
  1607.     number it is discussed in: 
  1608.  
  1609.                  (Section 9:2:1)    (9:2:3)     (Section 9:2:5)
  1610.                             |          |                   |
  1611.               @Traverse ([setup],mode,type,angle,distance,fmt)
  1612.                                   |          |
  1613.                       (Section 9:2:2)     (9:2:4) 
  1614.  
  1615.  
  1616.  
  1617.     9:2:1   REFERENCING OTHER COORDINATES
  1618.  
  1619.                 @Traverse ([SETUP],mode,type,angle,distance,fmt) 
  1620.                            ^ 
  1621.             Whenever you see a parameter that is enclosed within Square 
  1622.             Brackets [], it takes on special meaning.  A parameter of this 
  1623.             type MUST be the Cell Address ([row,col]) of a cell that 
  1624.             contains a POINT, SEGMENT or POLYGON (depending on the 
  1625.             function's requirements). If you attempt to address a cell that 
  1626.             does not contain the proper cell type, an error will be 
  1627.             returned.  In the above example, '[setup]' represents the cell 
  1628.             that contains the coordinate from which the 'angle' and 
  1629.             'distance' are measured. 
  1630.  
  1631.             Note:  The @XY, @NE, and @POLAR functions provide the easiest 
  1632.             means of loading a cell with the initial coordinate from which 
  1633.             other coordinates are computed.  This 'initial' point is 
  1634.             normally known and therefore must be loaded directly before it 
  1635.             can be reference by other '@' functions. 
  1636.  
  1637.  
  1638.     9:2:2   SETTING THE ANGLE MODE  (radians, degrees, grads)
  1639.  
  1640.                 @Traverse ([setup],MODE,type,angle,distance,fmt) 
  1641.                                    ^ 
  1642.             The 'mode' parameter tells the spreadsheet what unit of 
  1643.             measure to assume for all angles used in the function's
  1644.             parameter list.  Four angular modes (0-3) are available: 
  1645.  
  1646.               mode=0   Radians
  1647.               mode=1   Degrees  (decimal)   DDD.ddd
  1648.               mode=2   Grads  
  1649.               mode=3   Degrees  (degrees,minutes,seconds)  DDD.MMSSss
  1650.  
  1651.  
  1652.     9:2:3   SETTING THE ANGLE TYPE
  1653.  
  1654.                 @Traverse ([setup],mode,TYPE,angle,distance,fmt) 
  1655.                                         ^ 
  1656.             The 'type' parameter tells the spreadsheet what kind of angle 
  1657.             (bearing, azimuth, ray, etc..) to assume for the angles that are 
  1658.             used or returned by the function.  There are nine possible 
  1659.             settings.  The first five (0-4) identify a group of Direction 
  1660.             Angles, which define the absolute direction of a line relative 
  1661.             to the xy-axis.  The remaining four settings (5-8) identify 
  1662.             Field Angles that require a 'backsight' coordinate to establish 
  1663.             their relative direction. 
  1664.  
  1665.             Direction Angle settings (0-4):
  1666.  
  1667.                type=0   Ray         (counter-clockwise about the +x axis) 
  1668.                type=1   Bearing     (90 degrees about the (+/-) y axis)
  1669.                type=2   Azimuth No  (clockwise about the +y axis)
  1670.                type=3   Azimuth So  (clockwise about the -y axis)
  1671.                type=4   Rotation    (180 deg - either direction of +x axis)
  1672.  
  1673.  
  1674.                (0)         (1)         (2)         (3)         (4)
  1675.  
  1676.                 | 360    90<|>90        |>360       |           | 180
  1677.              ---+--^-   ----+----   ----+---    ----+----   ----+--+-
  1678.                 |        90<|>90        |       360<|           | 180
  1679.  
  1680.                Ray       Bearing     Azimuth     Azimuth     Rotation
  1681.                                       (north)     (south)
  1682.  
  1683.  
  1684.             Field Angles settings (5-8):
  1685.  
  1686.                type=5   Angle Right       (right of the backsight)
  1687.                type=6   Angle Left        (left of backsight)
  1688.                type=7   Deflection Right  (right from line 180d of backsight)
  1689.                type=8   Deflection Left   (left from line 180d of backsight) 
  1690.  
  1691.                     (point measured to)
  1692.                              \               (backsight)    
  1693.                        - - - >\    6 |  6   /           
  1694.                       |        \<- - |- - -/  8
  1695.                       |7        \<- -|- - / - -     
  1696.                       |      - ->\   |   /     |
  1697.                       |    5|     \  |  /--    |8
  1698.                       |     |  setup | /   |   | 
  1699.                       |-----|--------+-----|---|----
  1700.                       |     |       /|    5|   |     
  1701.                       |    5|      / |     |   |8    
  1702.                       |      - - -/- |- - -    |    
  1703.                       |7         /   |         |    
  1704.                       |         /- - |- - - - -     
  1705.                       |   7    /  8  |      8       
  1706.                        - - - -/      |          
  1707.                              /
  1708.                            (line - 180 degrees from backsight)
  1709.  
  1710.  
  1711.     9:2:4   ENTERING ANGLES
  1712.  
  1713.                 @Traverse ([setup],mode,type,ANGLE,distance,fmt) 
  1714.                                              ^ 
  1715.             If you used one of the first three angle 'mode' settings (0 
  1716.             thru 2), the angle must be entered using a decimal format. For 
  1717.             example, mode (1) angles are entered as follows:  DDD.dddd, 
  1718.             where the 'dddd' represents decimal degrees.  Mode (3) angles, 
  1719.             on the other hand, require angles to be entered in degrees, 
  1720.             minute, and seconds (DDD.MMSSss) where: 'DDD' denotes whole 
  1721.             degrees; 'MM' denotes minutes;  'SS' denotes seconds; and 'ss' 
  1722.             denotes decimal seconds.  As an example, 75 30'20.95" would be 
  1723.             entered: 75.302095. 
  1724.  
  1725.             Bearing angles (i.e. mode=3, type=1) are the only angles that 
  1726.             require a somewhat unusual entry method, since both the 
  1727.             quadrant and the the angle itself must be entered as a single 
  1728.             value.  This is done by adding a special value to the bearing 
  1729.             angle itself to identifies its quadrant. The following diagram 
  1730.             illustrates these values:
  1731.  
  1732.                             (NW) +400  | +100  (NE)
  1733.                                  ------+------
  1734.                             (SW) +300  | +200  (SE)
  1735.  
  1736.             Note:  Since bearing angles can not be greater than 90 degrees, 
  1737.             adding the above values will not affect the angle itself and 
  1738.             can be otherwise ignored - except for identifying the quadrant. 
  1739.             For example, to represent the bearing N45 30'20"W , you would 
  1740.             enter:  445.3020  (i.e.  45.3020 + 400 ). 
  1741.  
  1742.  
  1743.  
  1744.     9:2:5   SETTING THE DISPLAY FORMAT
  1745.  
  1746.                 @Traverse ([setup],mode,type,angle,distance,FMT) 
  1747.                                                             ^ 
  1748.             As mentioned earlier, the '@' functions usually return multiple 
  1749.             values, which generally fall into two categories:  
  1750.             Rectangular/Polar Coordinates and Angle/Distance pairs.  The 
  1751.             'fmt' parameter is used to control how the spreadsheet displays 
  1752.             these values.  Several options in each category are available. 
  1753.  
  1754.  
  1755.             RECTANGULAR/POLAR coordinate display formats:
  1756.  
  1757.               fmt=0   XY Rectangular Coordinate format:  "(x, y)"
  1758.               fmt=1   North/East Coordinate format:      "[north, east]"
  1759.               fmt=2   Polar Coordinate display format:   "{radius, ray}"
  1760.               
  1761.               Notice the brackets used to enclose each coordinate type.  
  1762.               They'll help you distinguish between them when displayed.
  1763.               Also, note that when using the Polar Coordinate display
  1764.               format (fmt=2), both the entry and return mode of the 'ray'
  1765.               angle is established by the function's 'mode' parameter. 
  1766.  
  1767.               Keep in mind that no matter which display format is used, the 
  1768.               coordinate is always stored by the spreadsheet in the same 
  1769.               way (i.e. as a rectangular coordinate). The x_value is stored 
  1770.               in element position [1] and the y_value is stored in element 
  1771.               position [2].  The display format does not affect the actual 
  1772.               values stored by the cell. 
  1773.               
  1774.  
  1775.             ANGLE/DISTANCE display formats:
  1776.  
  1777.               fmt=0   General display format:   TYPE(mode)  ANGLE, DISTANCE
  1778.  
  1779.                       Example:     "BRG(dms) 445.3020, 100.00"
  1780.  
  1781.                       Note:  This format can be used to display any
  1782.                       angle type/mode combination.
  1783.  
  1784.               fmt=1   Bearing/Distance format:
  1785.  
  1786.                       Example:       "N45 30'20.0"W   100.00"
  1787.  
  1788.                       Note:  When using this display format, the function's
  1789.                       'mode' and 'type' settings will be ignored and the
  1790.                       angle will always be displayed in degrees, minutes
  1791.                       and seconds.
  1792.  
  1793.  
  1794.               
  1795.     ------------------------------------------------------------------------
  1796.     Section 9:3   FUNCTIONS THAT RETURN SINGLE COORDINATES
  1797.     ------------------------------------------------------------------------
  1798.  
  1799.     All of the functions described in this section return coordinate 
  1800.     pairs.  The first three of these functions (@XY, @NE, and @POLAR) are 
  1801.     unique in that they do not COMPUTE coordinates; rather, they are 
  1802.     designed to LOAD a fixed or known coordinate.  Without these functions, 
  1803.     it would be impossible to establish the initial point from which other 
  1804.     coordinates are computed.  Remember, you can not load a coordinate pair 
  1805.     into a cell's array area yourself (Section 9:7 discusses the one 
  1806.     exception to this case). 
  1807.  
  1808.     If an error is detected by any of these functions, a series of question 
  1809.     marks (?????) will appear in the cell's display.  You can identify the 
  1810.     exact problem by moving the Cell Pointer to this cell and then entering 
  1811.     the Edit Mode.  This will cause an error message to be displayed that 
  1812.     will hopefully help you correct the problem (refer back to Chapter 5).
  1813.  
  1814.  
  1815.  
  1816.     9:3:1   @XY (X_coordinate,Y_coordinate)
  1817.  
  1818.             This function is designed to allow you to load a fixed or known 
  1819.             (x,y) coordinate pair into a cell.  By default, the coordinate 
  1820.             is also displayed using this format.  Keep in mind, this 
  1821.             function does not 'compute' anything, it only loads a cell with 
  1822.             a known coordinate pair.  The function is used primarily to 
  1823.             establish an INITIAL point from which other coordinates can be 
  1824.             computed. 
  1825.     
  1826.             Return Contents of Array Area:
  1827.  
  1828.                      [0]:  1  (number of coordinates pairs)
  1829.                      [1]:  x-coordinate value of point
  1830.                      [2]:  y-coordinate value of point
  1831.  
  1832.             NOTE:  Refer to Section 9:7 for a details on how to use this 
  1833.             function without a parameter list.
  1834.  
  1835.  
  1836.     9:3:2   @NE (Northing,Easting)
  1837.  
  1838.             This function is identical to the @XY routine, except that it 
  1839.             loads and displays a coordinate using a (North,East) or (y,x) 
  1840.             format.  The coordinate, however, is stored internally in a 
  1841.             (x,y) format, allowing it to be used interchangeably with any 
  1842.             coordinate computed by this package. 
  1843.  
  1844.             Return Contents of Array Area:
  1845.  
  1846.                      [0]:  1  (number of coordinates pairs)
  1847.                      [1]:  x-coordinate value of point
  1848.                      [2]:  y-coordinate value of point
  1849.  
  1850.             NOTE:  Refer to Section 9:7 for a details on how to use this 
  1851.             function without a parameter list.
  1852.  
  1853.  
  1854.     9:3:3   @POLAR (radius,ray)
  1855.  
  1856.             Like @XY and @NE, the @POLAR function is used to enter a fixed 
  1857.             or known coordinate.  The coordinate, however, must be entered 
  1858.             in a 'polar' format (radius,ray), where: the 'radius' is the 
  1859.             distance measured from the intersection of the xy-axis and the 
  1860.             'ray' is the angle measured counter clockwise from the positive 
  1861.             x-axis.  The 'ray' angle MUST be entered in RADIANS when using 
  1862.             this function.  While the coordinate is displayed in the same 
  1863.             polar format that was used to enter it, it is stored internally  
  1864.             as a rectangular coordinate - exactly as all other coordinates. 
  1865.             This allows it to be used interchangeably with all other 
  1866.             coordinates generated by this package. 
  1867.  
  1868.             Return Contents of Array Area:
  1869.  
  1870.                      [0]:  1  (number of coordinates pairs)
  1871.                      [1]:  x-coordinate value of point
  1872.                      [2]:  y-coordinate value of point
  1873.  
  1874.             NOTE:  Refer to Section 9:7 for a details on how to use this 
  1875.             function without a parameter list.
  1876.  
  1877.  
  1878.     9:3:4   @Traverse ([setup],mode,type,angle,distance,fmt)
  1879.  
  1880.             This function computes the next point, given an initial 
  1881.             coordinate '[setup]', an 'angle', and a horizontal 'distance'.  
  1882.             Any of the four available 'mode' settings (0-3) may be used, 
  1883.             however, the angle 'type' is limited to Direction Angles (types 
  1884.             0 thru 4).  Refer back to Section 9:2:5 for the 'fmt' display 
  1885.             settings that are available. 
  1886.                        
  1887.             Return Contents of Array Area:
  1888.  
  1889.                      [0]:  Contains the 'ray' angle in decimal degrees of
  1890.                              the line INTO the point computed by this
  1891.                              function.  This angle (mode=1, type=0) can be
  1892.                              used by other functions.
  1893.                      [1]:  x-coordinate value of point
  1894.                      [2]:  y-coordinate value of point
  1895.  
  1896.  
  1897.     9:3:5   @FieldAngle ([backsight],[setup],mode,type,angle,vert,dist,fmt)
  1898.  
  1899.             The @FieldAngle function is similar to the @Traverse function, 
  1900.             except that it also allows Field Angles (i.e. 'type' 5 thru 8) 
  1901.             to be used to compute the coordinate of the next point.  As a 
  1902.             result, a '[backsight]' coordinate is required to establish the 
  1903.             direction of the line from which the field angle is measured. 
  1904.             When using Direction Angles (i.e. 'type' 0 thru 4), the 
  1905.             [backsight] coordinate is ignored.  This function will except 
  1906.             either a slope or a horizontal distance to the next point, 
  1907.             depending on how the vertical angle ('vert') parameter is set.  
  1908.             For slope distances, the vertical angle is measured 0 upto 90 
  1909.             degrees above the horizontal plane or 360 down to 270 degrees 
  1910.             below the horizontal plane.  The 'vert' parameter should be set 
  1911.             to '0' when entering a horizontal distance.  The 'mode' setting 
  1912.             applies to both the 'angle' and 'vert' parameters. 
  1913.  
  1914.             Return Contents of Array Area:
  1915.  
  1916.                      [0]:  Contains the 'ray' angle in decimal degrees of
  1917.                              the line INTO the point computed by this
  1918.                              function.  This angle (mode=1, type=0) can be
  1919.                              used by other functions.
  1920.                      [1]:  x-coordinate value
  1921.                      [2]:  y-coordinate value
  1922.  
  1923.  
  1924.     9:3:6   @AngAngInt ([point1],[point2],mode,type,angle1,angle2,fmt)
  1925.  
  1926.             Given two coordinate pairs ([point1] and [point2]) and a 
  1927.             Direction Angle from each ('angle1' and 'angle2',respectively), 
  1928.             this function will compute the point of intersection.  Any of 
  1929.             the four available 'mode' settings (0-3) may be used, however, 
  1930.             the angle 'type' is limited to Direction Angles (i.e. type 0 
  1931.             thru 4).  Refer back to Section 9:2:5 for the 'fmt' display 
  1932.             settings that are available. 
  1933.  
  1934.             Limitations:  This function will return an error if you attempt 
  1935.             to find the intersection of two parallel lines. 
  1936.  
  1937.             Return Contents of Array Area:
  1938.  
  1939.                      [0]:  1  (number of coordinates pairs)
  1940.                      [1]:  x-coordinate value
  1941.                      [2]:  y-coordinate value
  1942.  
  1943.  
  1944.     9:3:7   @AngDstInt ([point1],[point2],mode,type,angle1,distance2,fmt)
  1945.  
  1946.             Given two coordinate pairs ([point1] and [point2]) and a 
  1947.             Direction Angle measured from the first point (angle1) and a 
  1948.             distance measured from the second (distance2), this function 
  1949.             will compute the point of intersection.  Any of the four 
  1950.             available 'mode' settings (0-3) may be used, however, the angle 
  1951.             'type' is limited to Direction Angles (i.e. type 0 thru 4).  
  1952.             Refer back to Section 9:2:5 for the 'fmt' display settings that 
  1953.             are available.                         
  1954.  
  1955.             Note:  Two solutions are possible.  The second is found by 
  1956.             adding 180 degrees to the angle measured from [point1].  
  1957.  
  1958.             Return Contents of Array Area:
  1959.  
  1960.                      [0]:  1  (number of coordinates pairs)
  1961.                      [1]:  x-coordinate value
  1962.                      [2]:  y-coordinate value
  1963.  
  1964.  
  1965.     9:3:8   @DstDstInt ([point1],[point2],distance1,distance2,fmt)
  1966.  
  1967.             Given two coordinate pairs ([point1] and [point2]) and a 
  1968.             distance measured from each (distance1 and distance2), this 
  1969.             function will compute the point of intersection. 
  1970.  
  1971.             Note:  Two solutions are possible.  The second solution is 
  1972.             found by reversing the order of the coordinate and distance 
  1973.             parameters.  That is, the computed solution is always clockwise 
  1974.             from point 1 to point 2. 
  1975.  
  1976.             Limitations:  No solution is possible when the distance between 
  1977.             points 1 and 2 is greater than the sum of the two distances used 
  1978.             in the function. 
  1979.  
  1980.             Return Contents of Array Area:
  1981.  
  1982.                      [0]:  1  (number of coordinates pairs)
  1983.                      [1]:  x-coordinate value
  1984.                      [2]:  y-coordinate value
  1985.  
  1986.  
  1987.     9:3:9   @CurveRadius ([PC],[PI],mode,radius,fmt)
  1988.  
  1989.             This function returns the coordinate of the PT  (Point of 
  1990.             Tangency - where the curve ends), given the coordinate of the 
  1991.             PC (Point of Curvature - where the curve begins), the PI (Point 
  1992.             of Intersection of the two tangents), and the 'radius' of the 
  1993.             curve.  A curve to the right is assumed if the 'radius' is 
  1994.             positive.  A negative 'radius' will cause the function to 
  1995.             compute the curve to the left.  The 'mode' parameter is used to 
  1996.             establish the mode of the delta angle that is returned in the 
  1997.             array area. 
  1998.                    
  1999.             Note:  Even though this function returns a complete curve
  2000.             solution that is loaded in the cell's array area, its primary
  2001.             results (the PT) can still be referenced by other functions as
  2002.             a single coordinate.  The extra information is essentially
  2003.             ignored. 
  2004.  
  2005.             Return Contents of the Array Area:
  2006.  
  2007.                     [0]: =  3  (number of coordinates pairs)
  2008.                     [1]  =  (x) PT
  2009.                     [2]  =  (y) PT
  2010.                     [3]  =  (x) RP
  2011.                     [4]  =  (y) RP
  2012.                     [5]  =  (x) PI
  2013.                     [6]  =  (y) PI
  2014.                     [7]  =  radius 
  2015.                     [8]  =  tangent
  2016.                     [9]  =  chord
  2017.                    [10]  =  bearing of chord  (DMS)
  2018.                    [11]  =  arc
  2019.                    [12]  =  delta (central angle)
  2020.                    [13]  =  degree of curve
  2021.                    [14]  =  sector area
  2022.                    [15]  =  segment area
  2023.  
  2024.  
  2025.     9:3:10  @CurveDelta ([PC],[RP],mode,delta,fmt)
  2026.  
  2027.             This function returns the coordinate of the PT (Point of 
  2028.             Tangency - where the curve ends), given the coordinate of the 
  2029.             PC (Point of Curvature - where the curve first begins), the RP 
  2030.             (Radius Point), and the 'delta' (central) angle.  A curve to
  2031.             the right is assumed if the 'delta' angle is positive; while a
  2032.             negative 'delta' angle entry will cause the function to compute
  2033.             the curve to the left. The 'mode' parameter is used to establish
  2034.             the mode of the delta angle. 
  2035.  
  2036.             Note:  Even though this function returns a complete curve
  2037.             solution that is loaded in the cell's array space, its primary
  2038.             results (the PT) can still be referenced by other functions as
  2039.             a single coordinate.  The extra information is essentially
  2040.             ignored. 
  2041.  
  2042.             Return Contents of the Array Area:
  2043.  
  2044.                     [0]: =  3  (number of coordinates pairs)
  2045.                     [1]  =  (x) PT
  2046.                     [2]  =  (y) PT
  2047.                     [3]  =  (x) RP
  2048.                     [4]  =  (y) RP
  2049.                     [5]  =  (x) PI
  2050.                     [6]  =  (y) PI
  2051.                     [7]  =  radius 
  2052.                     [8]  =  tangent
  2053.                     [9]  =  chord
  2054.                    [10]  =  bearing of chord  (DMS)
  2055.                    [11]  =  arc
  2056.                    [12]  =  delta (central angle)
  2057.                    [13]  =  degree of curve
  2058.                    [14]  =  sector area
  2059.                    [15]  =  segment area
  2060.  
  2061.  
  2062.  
  2063.     ------------------------------------------------------------------------
  2064.     Section 9:4   FUNCTIONS THAT RETURN:  MULTIPLE COORDINATES
  2065.     ------------------------------------------------------------------------
  2066.  
  2067.     The next two functions provide a means of grouping coordinates so that 
  2068.     they can be referenced as a single entity.  Coordinates can be grouped 
  2069.     to form either a line segment or a polygon.  For the purposes of this 
  2070.     package, a line 'segment' is defined as a series of two (2) or more 
  2071.     coordinates that form a contiguous (but not necessarily straight) line. 
  2072.     A 'polygon' is comprised of four (4) or more coordinates that form a 
  2073.     closed traverse, where the last coordinate closes on the first.  The 
  2074.     difference between the first and last coordinate is termed the 'error 
  2075.     of closure'. 
  2076.  
  2077.  
  2078.     9:4:1   @Segment ([point],[segment],...,[point])
  2079.  
  2080.             This function creates a special cell that contains a line 
  2081.             segment.  Segments are used by this spreadsheet as a means of 
  2082.             grouping related coordinates so that they can be referenced by a 
  2083.             single Cell Address.  These cells can be either plotted 
  2084.             individually or they can be used as building blocks to form 
  2085.             other segments or polygons. When plotted, they are treated as 
  2086.             separate entities and take on the color defined for the cell.
  2087.             Note: There are some limitations to the colors that can be used 
  2088.             to plot a segment - refer to Section 9:8. 
  2089.  
  2090.             The parameter list required by this function may contain as 
  2091.             many references to POINT or SEGMENT cells as you like (as long 
  2092.             as the final coordinate count is greater than 2).  An error will 
  2093.             be returned if you attempt to reference any other type of cell. 
  2094.             When referencing another SEGMENT cell, you are actually loading 
  2095.             all of its coordinates into the array area of the new segment.  
  2096.             You can do this in either forward or reverse order.  To reverse 
  2097.             the order in which a segment's coordinates are loaded, precede 
  2098.             the segment's Cell Address with a minus (-) sign.  This will 
  2099.             cause the last coordinate pair to be loaded first and so on.
  2100.  
  2101.             Once created, cells of this type will display the word "SEGMENT" 
  2102.             followed by the total number of coordinate pairs it contains. 
  2103.  
  2104.             Return Contents of the Array Area:
  2105.  
  2106.                     [0]  =  number of (x,y) coordinate pairs
  2107.                     [1]  =  x coordinate of 1st point
  2108.                     [2]  =  y coordinate of 1st point
  2109.                     [3]  =  x coordinate of 2nd point
  2110.                     [4]  =  y coordinate of 2nd point
  2111.                      :
  2112.  
  2113.             NOTE:  Refer to Section 9:7 for a details on how to use this 
  2114.             function without a parameter list.
  2115.  
  2116.  
  2117.     9:4:2   @Polygon ([point],[segment],...[point])
  2118.  
  2119.             This function creates a special cell that contains a set of 
  2120.             coordinates that form a polygon.  Once created, the polygon can 
  2121.             be either plotted (Section 9:8) or its area and the 'error of 
  2122.             closure' can be computed with the @Closure function (Section 
  2123.             9:5:3).  Note: Because polygons form closed figures, they 
  2124.             technically do not have a beginning and end point.  As a result, 
  2125.             POLYGON cells can not be used as building blocks to form other 
  2126.             polygons or line segments. 
  2127.  
  2128.             The parameter list required by this function may contain as many 
  2129.             references to POINT or SEGMENT cells as you like.  A total of 4 
  2130.             or more coordinates, however, are required to form a polygon. An 
  2131.             error will be returned if you attempt to reference any other 
  2132.             type of cell.  When referencing a SEGMENT cell, you are actually 
  2133.             loading its coordinates into the array area of the polygon.  You 
  2134.             can do this in either forward or reverse order.  To reverse the 
  2135.             order in which a segment's coordinates are loaded, precede the 
  2136.             segment's Cell Address with a minus (-) sign.  This will cause 
  2137.             the last coordinate to be loaded first.  Once the polygon is 
  2138.             formed, any difference between the first and last coordinate 
  2139.             loaded is termed the 'error-of-closure'. 
  2140.                                          
  2141.             Once created, cells of this type will display the word "POLYGON" 
  2142.             followed by the total number of coordinates that make up the 
  2143.             polygon. 
  2144.  
  2145.             Return Contents of the Array Area:
  2146.  
  2147.                     [0]  =  number of (x,y) coordinate pairs
  2148.                     [1]  =  x coordinate of 1st point
  2149.                     [2]  =  y coordinate of 1st point
  2150.                     [3]  =  x coordinate of 2nd point
  2151.                     [4]  =  y coordinate of 2nd point
  2152.                      :
  2153.  
  2154.             NOTE:  Refer to Section 9:7 for a details on how to use this 
  2155.             function without a parameter list.
  2156.  
  2157.  
  2158.  
  2159.     ------------------------------------------------------------------------
  2160.     Section 9:5   FUNCTIONS THAT RETURN AN ANGLE and DISTANCE 
  2161.     ------------------------------------------------------------------------
  2162.  
  2163.     The next three functions return the angle and distance between two 
  2164.     coordinates.  Two display formats are supported by setting the 'fmt' 
  2165.     parameter to either 0 or 1, where 0 is the General Display Format and 1 
  2166.     is the Bearing Display Format (refer back to Section 9:2:5).  The 'mode' 
  2167.     and 'type' parameters are used to define the angle that will be 
  2168.     displayed. 
  2169.  
  2170.  
  2171.  
  2172.     9:5:1   @Inverse ([Point1],[Point2],mode,type,fmt)
  2173.  
  2174.             This function returns the angle and distance between two 
  2175.             coordinates, [Point1] and [Point2].  The angle that is returned 
  2176.             is controlled with the 'mode' and 'type' parameters.  Any of the 
  2177.             four available 'mode' settings (0-3) may be used, however, the 
  2178.             angle 'type' is limited to Direction Angles (i.e. type 0 thru 
  2179.             4).  Refer back to Section 9:2:5 for the 'fmt' display settings 
  2180.             that are available.                                 
  2181.             
  2182.             Return Contents of the Array Area: 
  2183.  
  2184.                     [0]  =  1  (number of coordinate pairs)
  2185.                     [1]  =  distance
  2186.                     [2]  =  angle
  2187.  
  2188.  
  2189.     9:5:2   @Radial ([BackSight],[Setup],[ForeSight],mode,type,fmt)
  2190.  
  2191.             This function returns the field angle ('type' 5-8) measured 
  2192.             BETWEEN the lines formed by the [Setup] and [Backsight] 
  2193.             coordinates AND the [Setup] and [ForeSight] coordinates.  In 
  2194.             addition to the angle, the distance between the [Setup] and 
  2195.             [ForeSight] coordinates is returned.  Any of the four available 
  2196.             'mode' settings (0-3) may be used, however, the angle 'type' is 
  2197.             limited to Field Angles (i.e. type 5 thru 8).  Refer back to 
  2198.             Section 9:2:5 for the 'fmt' display settings that are available. 
  2199.                   
  2200.             Return Contents of the Array Area: 
  2201.  
  2202.                     [0]  =  1  (number of coordinate pairs)
  2203.                     [1]  =  distance
  2204.                     [2]  =  angle
  2205.  
  2206.  
  2207.     9:5:3   @Closure ([polygon],mode,type,fmt)
  2208.  
  2209.             This function computes the 'Error of Closure' and 'Area' of the 
  2210.             coordinates that form a POLYGON (refer to Section 9:4:2). The 
  2211.             angle and distance between the first and last coordinates is 
  2212.             termed the 'Error of Closure' and is displayed by the function.  
  2213.             The 'mode' and 'type' settings control the angle display format.  
  2214.             Any of the four available 'mode' settings (0-3) may be used. The 
  2215.             angle 'type' setting, however, is limited to Direction Angles 
  2216.             (0-4).  Refer back to Section 9:2:5 for the 'fmt' display 
  2217.             settings that are available. The AREA of the polygon is stored 
  2218.             in element position [0], allowing it to be referenced directly 
  2219.             by formulas in other cells. 
  2220.  
  2221.             Return Contents of the Array Area:
  2222.  
  2223.                     [0]  =  AREA of polygon
  2224.                     [1]  =  DISTANCE between last and first coordinates
  2225.                               that form the polygon
  2226.                     [2]  =  ANGLE btw closing coordinates ('ray' angle)
  2227.                     [3]  =  Total length of the sides that form the polygon
  2228.  
  2229.     ------------------------------------------------------------------------
  2230.     Section 9:6   FUNCTIONS THAT RETURN:  MULTIPLE VALUE SOLUTIONS
  2231.     ------------------------------------------------------------------------
  2232.  
  2233.     9:6:1   @Triangle (mode,angleA,angleB,angleC,sidea,sideb,sidec)
  2234.  
  2235.             Given any THREE attributes of a triangle, this function will 
  2236.             return the full triangle solution in the cell's array area.  The 
  2237.             following combinations of attributes are supported:  ASA, SAA, 
  2238.             SSS, or SAS (where "SAS" means Side/Angle/Side).  When using 
  2239.             this routine, ONLY INCLUDE THREE ATTRIBUTES (even if more are 
  2240.             known)!  A '0' should be placed in the unknown attribute 
  2241.             positions.  The results can be displayed using the "=*" Element 
  2242.             Display Command described in Chapter 7. 
  2243.  
  2244.             NOTE:  The SSA option is not supported, since more than one
  2245.             solution is possible.
  2246.  
  2247.                       | \
  2248.                       | B \
  2249.                       |     \
  2250.                       |       \ a
  2251.                     c |         \
  2252.                       |           \
  2253.                       | A        C  \
  2254.                       |_______________\
  2255.                               b 
  2256.  
  2257.             Example (SSS):    @Triangle (3,0,0,0,3,4,5)
  2258.                                          |
  2259.                                          |__ mode of angles entered
  2260.                                              and returned
  2261.  
  2262.             Return Contents of the Array Area:
  2263.  
  2264.                     [0]  =  Area
  2265.                     [1]  =  Angle A
  2266.                     [2]  =  Angle B
  2267.                     [3]  =  Angle C
  2268.                     [4]  =  Side a
  2269.                     [5]  =  Side b
  2270.                     [6]  =  Side c
  2271.  
  2272.  
  2273.     ------------------------------------------------------------------------
  2274.     Section 9:7    NULL POINTS, SEGMENTS, and POLYGONS
  2275.     ------------------------------------------------------------------------
  2276.  
  2277.     Several of the functions discussed in this chapter can be used with an 
  2278.     empty (or null) parameter list.  They include:
  2279.    
  2280.                                  @XY()
  2281.                                  @NE()
  2282.                                  @POLAR()
  2283.                                  @Segment()
  2284.                                  @Polygon()
  2285.     
  2286.     The 'null' form of these functions allow you to control a cell's Array 
  2287.     Area.  That is, these functions identify a cell as containing a POINT, 
  2288.     SEGMENT, or POLYGON; but they do not create, load, or in anyway modify 
  2289.     its Array Area.  Those duties are left to you to handle, which can be 
  2290.     very handy.  Here are a few examples: 
  2291.  
  2292.     Example 1   Let's say you create a POLYGON using the standard form of 
  2293.                 the @Polygon function (i.e. you references several other 
  2294.                 SEGMENTS and POINTS within its parameter list).  And, 
  2295.                 let's say the coordinates the polygon is made up of are 
  2296.                 just the ones want - you do not want any of them to 
  2297.                 change.  The problem is, when the referenced POINTS and 
  2298.                 SEGMENTS change, so will the points used by the POLYGON.  
  2299.                 That how spreadsheets work.  How then do you save a 
  2300.                 POLYGON?  Simple, use the 'null' @Polygon() function.  
  2301.                 Just enter this function call in the cell that contains 
  2302.                 the polygon you want to preserve and you will break the 
  2303.                 ties to other cells on the worksheet. Nothing can effect 
  2304.                 these coordinates now - except you! 
  2305.  
  2306.     Example 2   Let's say you have a line SEGMENT that was formed by 
  2307.                 referencing a number of POINTS throughout the worksheet 
  2308.                 and that you want to copy this particular SEGMENT to 
  2309.                 another worksheet.  Will you have a problem doing this?  
  2310.                 The answer is "yes", if it's not a 'null' SEGMENT.  The 
  2311.                 reason is that copying a SEGMENT (that references other 
  2312.                 cells) to another worksheet would also require moving the 
  2313.                 referenced cells!  When copied, the SEGMENT will attempt 
  2314.                 to access cells at the same relative locations on the new 
  2315.                 worksheet as it did on the original worksheet.  If cells 
  2316.                 do not exist at these locations, an error condition will 
  2317.                 result.  To get around this, simply convert the standard 
  2318.                 function call to a 'null' @Segment() call on the new 
  2319.                 worksheet.  Note: Copying a POINT, SEGMENT or POLYGON by 
  2320.                 value (val) will automatically handle this situation for 
  2321.                 you (see Section 4:2). 
  2322.                    
  2323.     Example 3   Let's say you have a large polygon that you want to use 
  2324.                 in a number of different worksheets.  And, let's assume 
  2325.                 this particular polygon is not made up of coordinates 
  2326.                 that can found on these worksheets.  Is there is easy way 
  2327.                 to load such a polygon.  Yes, you can load the polygon 
  2328.                 into a cell that is defined by the 'null' @Polygon 
  2329.                 function from a standard text file.  Refer to the "f5 
  2330.                 Text" option of Section 4:3 for details. 
  2331.  
  2332.      REMEMBER!  WHEN USING 'NULL' FUNCTIONS, IT IS UP TO YOU TO MAKE SURE 
  2333.                 THE CELL'S ARRAY AREA EXISTS AND THAT IT IS LOADED 
  2334.                 CORRECTLY. 
  2335.  
  2336.  
  2337.     ------------------------------------------------------------------------
  2338.     Section 9:8   GRAPHICS
  2339.     ------------------------------------------------------------------------
  2340.  
  2341.     The @Segment and @Polygon functions are used to define geometric 
  2342.     'shapes' that, among other things, can be plotted.  When plotted, lines 
  2343.     are drawn between each coordinate that form these entities; while
  2344.     individual coordinates (POINTS) are plotted as single points.  
  2345.  
  2346.     Function keys F2 thru F6 of the UTILITY Menu are used to display the 
  2347.     points, lines, and polygons created by this Coordinate Geometry Package 
  2348.     (see Section 4:7).  You can plot as many of these objects as you like 
  2349.     (individually or together) by positioning the Cell Pointer over the cell 
  2350.     you wish to include and then  pressing the F6 (Plot) function key.  You 
  2351.     can continue to identify cells in this fashion until you press the 
  2352.     <Enter> key, which will initiate the display. 
  2353.  
  2354.     To provide compatibility with as many PCs as possible, REBEL uses video 
  2355.     BIOS calls for all of its graphics displays.  While this approach 
  2356.     extends graphic capabilities to a wide range of IBM-PCs and 
  2357.     compatibles, it does not always take full advantage of your system's 
  2358.     video adapter.  For example, only three colors can be displayed at a 
  2359.     time, which are grouped into two palettes (WHITE-CYAN-MAGENTA and 
  2360.     YELLOW-GREEN-RED).  The system will attempt to use the color defined 
  2361.     for a cell (as long as it remains in the same color palette). 
  2362.  
  2363.  
  2364.  
  2365.     ------------------------------------------------------------------------
  2366.     Section 9:9   EXAMPLES
  2367.     ------------------------------------------------------------------------
  2368.  
  2369.  
  2370.  
  2371.     Before trying out any of the following examples, be sure that the
  2372.     Column Width of column 3 is set to 27  (refer to 'Width' option
  2373.     discussed in Section 4:6).  And, initialize cells [1,3], [2,3], and
  2374.     [3,3] with the following coordinate pairs, by:
  2375.  
  2376.  
  2377.      . . . moving the Cell Pointer to [1,3] and enter:  @XY(2000,1000)
  2378.      . . . moving the Cell Pointer to [2,3] and enter:  @XY(500,500)
  2379.      . . . moving the Cell Pointer to [3,3] and enter:  @XY(1000,1000)
  2380.  
  2381.  
  2382.  
  2383.  
  2384.      Example 1)   TRAVERSE North 45 degrees 15 minutes and 30 seconds East
  2385.                   a distance of 378 feet from the point loaded in cell [3,3].
  2386.                   With the Cell Pointer positioned over cell [5,3] enter:
  2387.  
  2388.  
  2389.                          @Traverse([3,3],3,1,145.1530,378,0)
  2390.                                          | |   |          |_ XY display
  2391.                                          | |   |             format (9:2:5)
  2392.                                          | |   |
  2393.                     mode: degrees (dms) _| |   |__ bearing angle (9:2:4)
  2394.                            (9:2:2)         |__ angle type: bearing (9:2:3)
  2395.  
  2396.  
  2397.                   Answer Displayed:   (1268.49, 1266.08)
  2398.  
  2399.  
  2400.      Example 2)   Assume that, in the field, you are setup over point [3,3]
  2401.                   and that you are backsighting point [2,3].  Compute the
  2402.                   coordinate of a new point by turning an angle RIGHT of
  2403.                   22 degrees 30 minutes and measuring a distance of 78 feet.
  2404.                   With the Cell Pointer positioned over cell [6,3] enter:
  2405.  
  2406.                          mode: degrees (dms) __
  2407.                                                |
  2408.                        @FieldAngle([2,3],[3,3],3,5,22.30,0,78,0)
  2409.                                                  |       |
  2410.                              field angle right __|       |_ vertical
  2411.                                                              angle
  2412.  
  2413.                   Answer:   (927.94, 970.15)
  2414.  
  2415.  
  2416.      Example 3)   Compute the coordinate of the point that measures 750
  2417.                   feet from point [2,3] and 550 feet from the point [3,3].
  2418.                   With the Cell Pointer positioned over cell [7,3] enter:
  2419.  
  2420.                        @DstDstInt([2,3],[3,3],750,550,0)
  2421.  
  2422.                   Answer:   (510.07, 1249.93)
  2423.  
  2424.  
  2425.      Example 4)   Assume that point [2,3] is the PC (point of curve) and
  2426.                   that point [1,3] is the PI (point of intersection) of a
  2427.                   curve that bears to the left with a radius of 1028 feet.
  2428.                   Compute the coordinate of the PT (point of tangency);
  2429.                   together with a FULL CURVE SOLUTION.  With the Cell
  2430.                   Pointer positioned over cell [8,3] enter:
  2431.  
  2432.                   mode to be used to return delta angle _
  2433.                                                          |
  2434.                                 @CurveRadius([2,3],[1,3],3,-1028,0)
  2435.                                                            |
  2436.                       radius must be negative to compute __|
  2437.                         a curve to the left
  2438.  
  2439.                   Answer:   (934.36, 2198.08)
  2440.  
  2441.                   NOTE:  Use the "=*" command at the Input Line to
  2442.                   review the curve solution loaded in the cell's 
  2443.                   array area.
  2444.  
  2445.  
  2446.  
  2447.      Example 5)   Form a POLYGON with the initialized coordinates.
  2448.                   With the Cell Pointer positioned over cell [9,3] enter:
  2449.  
  2450.                             @Polygon([1,3],[2,3],[3,3],[1,3])
  2451.  
  2452.                   NOTE:  This figure can now be plotted (see Section 9:8).
  2453.  
  2454.  
  2455.  
  2456.      Example 6)   Compute the ERROR-OF-CLOSURE of the polygon formed in the
  2457.                   above example.  With the Cell Pointer positioned over
  2458.                   cell [10,3] enter:
  2459.  
  2460.                              @Closure([9,3],3,1,1)
  2461.  
  2462.                   Answer:   (N90 00'00.0"E   0.00)
  2463.  
  2464.                   NOTE: The AREA of the polygon is loaded in element
  2465.                   position [0].  To view it, type "=0" at the Input
  2466.                   Line (without the quotes).
  2467.  
  2468.  
  2469.      Example 7)   Compute the ANGLE and DISTANCE between the coordinates
  2470.                   loaded in cells [2,3] and [1,3].  With the Cell Pointer
  2471.                   positioned over cell [11,3] enter:
  2472.  
  2473.                               @Inverse([2,3],[1,3],3,1,1)
  2474.                                                        |
  2475.                       bearing/distance display format _|
  2476.  
  2477.                   Answer:   (N71 33'54.1"E  1581.14)
  2478.  
  2479.  
  2480.      Example 8)   Compute the ANGLE formed by the intersection of two lines
  2481.                   formed by the coordinates loaded in cell [1,3] (the
  2482.                   backsight), cell [2,3] (the setup or intersection), and
  2483.                   cell [3,3] (the foresight).  With the Cell Pointer
  2484.                   positioned over cell [12,4] enter:
  2485.  
  2486.                                 return angle right __
  2487.                                                      |
  2488.                          @Radial([1,3],[2,3],[3,3],3,5,0)
  2489.                                                        |
  2490.                                general display format__|
  2491.  
  2492.                   Answer:   (RHT(dms) 26.33542,  1581.14)
  2493.  
  2494.  
  2495.  
  2496.                                              _____________________________
  2497.     ________________________________________/  Chapter 10     MATRIX
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.                              Index of Functions     
  2504.  
  2505.  
  2506.  
  2507.        @Matrix  . . . . . . . creates and loads a matrix. . . . . . 10:5:1
  2508.        @MatrixAdd . . . . . . adds matrix A & B. . . . . . . . . .  10:5:2
  2509.        @MatrixCrossProduct. . cross product of matrix A & B . . . . 10:5:3
  2510.        @MatrixExponent  . . . multiplies a matrix by itself . . . . 10:5:4
  2511.        @MatrixInverse . . . . inverts a matrix  . . . . . . . . . . 10:5:5
  2512.        @MatrixProduct . . . . multiples matrix A & B  . . . . . . . 10:5:6
  2513.        @MatrixScalar  . . . . scalar multiplication . . . . . . . . 10:5:7
  2514.        @MatrixSolution  . . . returns solution set. . . . . . . . . 10:5:8
  2515.        @MatrixSubtract  . . . subtracts matrix B from A . . . . . . 10:5:9
  2516.        @MatrixTranspose . . . transposes matrix A . . . . . . . . . 10:5:10
  2517.        determinant  . . . . . returns the determinant . . . . . . . 10:6:1
  2518.        dotproduct . . . . . . returns the dot product . . . . . . . 10:6:2
  2519.  
  2520.  
  2521.  
  2522.  
  2523.  
  2524.     ------------------------------------------------------------------------
  2525.     Section 10:1    ABOUT THIS PACKAGE
  2526.     ------------------------------------------------------------------------
  2527.  
  2528.     Like the functions used in the Coordinate Geometry package, these 
  2529.     functions also take advantage of several of REBEL's more advanced 
  2530.     features.  As a result, it is NOT advisable to jump immediately into 
  2531.     this chapter without first becoming familiar with the topics discussed 
  2532.     in Chapter 6.  I highly recommend, that at a very minimum, you become 
  2533.     familiar with the concept of "Cell Array Areas" (Section 6:5) before 
  2534.     continuing. 
  2535.  
  2536.     Once you learn how a matrix is created and stored, you will find that 
  2537.     these functions are simple to use.  As with the COGO functions, there 
  2538.     are a few important differences that distinguish them from the standard 
  2539.     functions that were covered in Charter 8.  The most significant of these 
  2540.     differences is the way in which values are returned and displayed.  
  2541.     While standard functions (and expressions) always return a single value 
  2542.     that is displayed by the cell, MATRIX @functions always return multiple 
  2543.     values that are loaded into the cell's Array Area. These values comprise 
  2544.     the elements of the matrix and are not displayed by the spreadsheet.  
  2545.     Cells that contain matrices will display the the number of rows and 
  2546.     columns a matrix contains (its size) followed by the word "MATRIX".  
  2547.     Another important distinction is that MATRIX @functions can not be 
  2548.     nested within the parameter lists of other functions, since they return 
  2549.     multiple values.  If used, they must be the only entry in a cell's 
  2550.     formula. 
  2551.               
  2552.     ------------------------------------------------------------------------
  2553.     Section 10:2   DEFINING, LOADING  AND EDITING A MATRIX
  2554.     ------------------------------------------------------------------------
  2555.  
  2556.     The '@Matrix' function (described in Section 10:5:1) is used to create 
  2557.     and load a matrix whose element values are known.  All of the other 
  2558.     matrix functions described in this chapter create new matrices based on 
  2559.     an operation performed on one or more existing matrix. You can load a 
  2560.     matrix by either entering the values that form the matrix directly into 
  2561.     the parameter list of the '@Matrix' function: 
  2562.  
  2563.                   @Matrix (3,4, 2,4,7,0, 1,1,9,7, 3,1,0,9) 
  2564.  
  2565.     or by setting up the @Matrix function to reference values in other 
  2566.     cells that can be more easily changed:
  2567.  
  2568.                @Matrix (2,3, [5,1],[5,2],[5,3], [6,1],[6,2],[6,3]) 
  2569.  
  2570.     One word of caution, if you decide to use the second method, keep in 
  2571.     mind that each time a value in cells [5,1] thru [6,3] is changed, it 
  2572.     could trigger a whole series of matrix operations to be performed. 
  2573.     Since you'll probably want to prevent this from happening until you 
  2574.     have completed all of your changes, you will need to set the +NoCalc 
  2575.     flag described in Section 4:1.  This setting will prevent the cell that 
  2576.     contains the matrix (whose element values your are modifying) from 
  2577.     triggering other cells from recalculating - even though their values are 
  2578.     affected by the changes.  The 'CelCalc' option listed under the UTILITY 
  2579.     menu (Section 4:7) can then be used to force a recalculation of the 
  2580.     affected cells whenever you are ready. 
  2581.  
  2582.  
  2583.     ------------------------------------------------------------------------
  2584.       Section 10:3   DISPLAYING A MATRIX
  2585.     ------------------------------------------------------------------------
  2586.  
  2587.     As mentioned earlier, the spreadsheet does not display the element 
  2588.     values of a matrix.  It is left to the you to decide whether or not to 
  2589.     display these values and by which method.  The simplest way to display 
  2590.     the elements of a matrix is to use the "=" Shortcut Command.  To use 
  2591.     this command, simply move the Cell Pointer to the cell that contains a 
  2592.     matrix and type an equal sign (=) at the Input Line and then press the 
  2593.     <Enter> key.  This will cause a single row of the matrix to be displayed 
  2594.     each time the <Enter> key is pressed.  There are a number of variations 
  2595.     to this command that can also be used (refer to Chapter 7 for details). 
  2596.  
  2597.     You can also display the elements of a matrix, on the screen, by 
  2598.     referencing the Array Area of the matrix cell from other cells.  To do 
  2599.     this, however, it requires a knowledge of how the matrix is stored in 
  2600.     the Array Area.  The first two array positions contain the number of 
  2601.     ROWS and COLUMNS in the matrix.  This is followed by the value of each 
  2602.     element beginning with the first column of the first row and moving 
  2603.     left-to-right to the last column in the last row.  The first two 
  2604.     parameters determine the total number of entries that are contained in 
  2605.     the array. 
  2606.  
  2607.                Array
  2608.               Position              Contents
  2609.  
  2610.                 [1]       The number of ROWS in the matrix
  2611.                 [2]       The number of COLUMNS in the matrix
  2612.                 [3]       Element loaded in the 1st COLUMN of the 1st ROW
  2613.                 [4]       Element loaded in the 2nd COLUMN of the 1st ROW
  2614.                  :
  2615.                 [n]       Element in the last COLUMN of the last ROW
  2616.  
  2617.     For example, if you wanted to display the 1st element in the 1st row of 
  2618.     a matrix that is defined is cell [5,1], you could make the following 
  2619.     array reference from any empty cell:  [5,1,3]. 
  2620.  
  2621.     REMEMBER!  THE FIRST TWO ARRAY POSITIONS CONTAIN THE NUMBER OF ROWS AND 
  2622.     COLUMNS IN THE MATRIX. THE ELEMENT VALUES ARE LOADED, STARTING AT ARRAY 
  2623.     POSITION THREE (3)!
  2624.  
  2625.  
  2626.     ------------------------------------------------------------------------
  2627.     Section 10:4   REFERENCING OTHER MATRICES
  2628.     ------------------------------------------------------------------------
  2629.  
  2630.     Many functions in this package reference other matrices in their 
  2631.     parameter lists.  To help distinguish a 'matrix' reference from other 
  2632.     parameters, they have been enclosed within a set of square brackets [] 
  2633.     in the functions that follow.  A 'matrix' reference takes on special 
  2634.     meaning.  For example, it must be a Cell Address ([row,col]) of a cell 
  2635.     that contains a MATRIX (or in some cases a POINT, SEGMENT or POLYGON, 
  2636.     depending on the function's requirements).  If you attempt to address a 
  2637.     cell that does not contain the proper cell type, an error will be 
  2638.     returned. 
  2639.  
  2640.  
  2641.     ------------------------------------------------------------------------
  2642.     Section 10:5   MATRIX FUNCTIONS THAT RETURN ANOTHER MATRIX
  2643.     ------------------------------------------------------------------------
  2644.  
  2645.     All of the functions described in this section will return a 'matrix' 
  2646.     upon completion.  As a result, the 'Cell Address' of any CELL that 
  2647.     contains one of these function calls can be used as a parameter within 
  2648.     another matrix function call.  Remember, a Matrix @Function 'call' 
  2649.     cannot be nested within the parameter list of another function call, 
  2650.     but the 'Cell Address' of a CELL that contains a matrix CAN be used as 
  2651.     a parameter.  So, whenever you see a function parameter surrounded by 
  2652.     square brackets, such as [matrix_A], it is referring to the the Cell 
  2653.     Address of a cell that contain a matrix (or in some cases a POINT, 
  2654.     SEGMENT or POLYGON). 
  2655.  
  2656.     If an error is detected by any of these functions, a series of question 
  2657.     marks (?????) will appear in the cell's display.  You can identify the 
  2658.     exact problem by moving the Cell Pointer to the cell in question and 
  2659.     then entering the Edit Mode.  This will cause an error message to be 
  2660.     displayed that will hopefully help you correct the problem (refer back 
  2661.     to Chapter 5). 
  2662.  
  2663.             ________________________________________________________
  2664.  
  2665.  
  2666.     10:5:1  @Matrix (rows, columns, element1, element2, ... elementn)
  2667.  
  2668.             This function creates a matrix of the size defined by the 
  2669.             first two parameters.  The next series of parameters are 
  2670.             used to load the matrix elements, beginning with the first 
  2671.             column of the first row and moving left-to-right to the 
  2672.             last column in the last row.  The first two parameters 
  2673.             determine the total number of entries that must be made.  
  2674.             For example, the following function call would be used to 
  2675.             load this 3x4 matrix:
  2676.              
  2677.                                  | 2  4  7  0 |
  2678.                                  | 1  1  9  7 |
  2679.                                  | 3  1  0  9 |
  2680.  
  2681.                     @Matrix (3,4, 2,4,7,0, 1,1,9,7, 3,1,0,9) 
  2682.  
  2683.  
  2684.             Return contents of the cell's Array Area:
  2685.  
  2686.                 [0]   (not used)
  2687.                 [1]   The number of ROWS in the matrix
  2688.                 [2]   The number of COLUMNS in the matrix
  2689.                 [3]   Element loaded in the 1st COLUMN of the 1st ROW
  2690.                 [4]   Element loaded in the 2nd COLUMN of the 1st ROW
  2691.                  :
  2692.                 [n]   Element in the last COLUMN of the last ROW
  2693.  
  2694.             ________________________________________________________
  2695.  
  2696.  
  2697.     10:5:2  @MatrixAdd ([matrix_A],[matrix_B])
  2698.  
  2699.             ADDS matrix A and matrix B, returning matrix C that is 
  2700.             loaded in the Array Area of the cell that contains this 
  2701.             function call.  The format used to load matrix C in the 
  2702.             cell's Array Area is described in Section 10:5:1.  Note, 
  2703.             the parameter '[matrix_A]' refers to the Cell Address of 
  2704.             the cell that contains matrix A.                 
  2705.  
  2706.             Requirements:
  2707.  
  2708.                 (i)  Matrix A and B must be the same size.
  2709.  
  2710.             ________________________________________________________
  2711.  
  2712.  
  2713.     10:5:3  @MatrixCrossProduct ([matrix_A], [matrix_B]) 
  2714.  
  2715.             Computes the CROSS PRODUCT of matrix A and B, returning 
  2716.             matrix C that is loaded in the Array Area of the cell that 
  2717.             contains this function call.  The format used to load 
  2718.             matrix C in the cell's Array Area is described in Section 
  2719.             10:5:1. Note, the parameter '[matrix_A]' refers to the 
  2720.             Cell Address of the cell that contains matrix A. 
  2721.  
  2722.             Requirements:
  2723.  
  2724.                 (i)  Both matrix A and B must be 1X3 matrices.
  2725.  
  2726.             ________________________________________________________
  2727.  
  2728.  
  2729.     10:5:4  @MatrixExponent ([matrix_A], power)
  2730.  
  2731.             Matrix A is MULTIPLIED by itself the number of times set 
  2732.             by the 'power' variable, returning matrix C that is loaded 
  2733.             in the Array Area of the cell that contains this function 
  2734.             call. The format used to load matrix C in the cell's Array 
  2735.             Area is described in Section 10:5:1.   Note, the parameter 
  2736.             '[matrix_A]' refers to the Cell Address of the cell that 
  2737.             contains matrix A. 
  2738.  
  2739.             Requirements:
  2740.  
  2741.                 (i)  Matrix A must be a square matrix.
  2742.  
  2743.                (ii)  The 'power' variable must be a whole number > 1
  2744.  
  2745.             ________________________________________________________
  2746.  
  2747.  
  2748.     10:5:5  @MatrixInverse ([matrix_A])
  2749.  
  2750.             Computes the INVERSE of matrix A, returning a matrix (C) 
  2751.             that is loaded in the Array Area of the cell that contains 
  2752.             this function call.  (It should be noted that multiplying 
  2753.             matrix A by matrix C will produces the 'identity matrix'.)  
  2754.             The format used to load matrix C in the cell's Array Area 
  2755.             is described in Section 10:5:1.   Note, the parameter 
  2756.             '[matrix_A]' refers to the Cell Address of the cell that 
  2757.             contains matrix A. 
  2758.  
  2759.             Requirements:
  2760.  
  2761.                 (i)  Matrix A must be a square matrix.
  2762.  
  2763.             ________________________________________________________
  2764.  
  2765.  
  2766.     10:5:6  @MatrixProduct ([matrix_A], [matrix_B])
  2767.  
  2768.             MULTIPLIES matrix A by matrix B, returning matrix C that is
  2769.             loaded in the Array Area of the cell that contains this 
  2770.             function call.  Matrix C will have the same number of ROWS 
  2771.             as matrix A and the same number of COLUMNS as matrix B. 
  2772.             The format used to load matrix C in the cell's Array Area 
  2773.             is described in Section 10:5:1.   Note, the parameter 
  2774.             '[matrix_A]' refers to the Cell Address of the cell that 
  2775.             contains matrix A. 
  2776.  
  2777.             Requirements:
  2778.  
  2779.                  (i)  The number of columns in matrix A must equal the
  2780.                       number of rows in matrix B.
  2781.  
  2782.             ________________________________________________________
  2783.  
  2784.  
  2785.     10:5:7  @MatrixScalar ([matrix_A], scalar)
  2786.  
  2787.             MULTIPLIES matrix A by a single number (scalar), returning 
  2788.             matrix C that is loaded in the Array Area of the cell that 
  2789.             contains this function call. The format used to load 
  2790.             matrix C in the cell's Array Area is described in Section 
  2791.             10:5:1. Note, the parameter '[matrix_A]' refers to the 
  2792.             Cell Address of the cell that contains matrix A. 
  2793.  
  2794.             ________________________________________________________
  2795.  
  2796.  
  2797.     10:5:8  @MatrixSolution ([matrix_A])
  2798.  
  2799.             SOLVES a system of simultaneous equations represented by
  2800.             the augmented matrix A, returning the solution set in
  2801.             matrix C that is loaded in the Array Area of the cell that 
  2802.             contains this function. Matrix C is always returned as a 
  2803.             (m x 1) matrix, where m equals the number of rows in 
  2804.             matrix A.  The format used to load matrix C in the cell's 
  2805.             Array Area is described in Section 10:5:1.  Note, the 
  2806.             parameter '[matrix_A]' refers to the Cell Address of the 
  2807.             cell that contains matrix A. 
  2808.  
  2809.             Requirements:
  2810.  
  2811.                  (i)  Matrix A must be an augmented matrix, where
  2812.                       the rows of the matrix represent the coefficients
  2813.                       of the variables followed by the constant term.
  2814.                       For example:
  2815.  
  2816.                             System                 Augmented Matrix
  2817.  
  2818.                          x -  y +   z = 0          | 1  -1   1   0 |
  2819.                         3x + 4y +  2z = 1          | 3   4   2   1 |
  2820.                         2x + 7y + 13z = 2          | 2   7  13   2 |
  2821.  
  2822.  
  2823.                 (ii)  The number of equations (rows) must equal the
  2824.                       number of variables.  That is, matrix A must
  2825.                       have one more column than it does rows.
  2826.  
  2827.             ________________________________________________________
  2828.  
  2829.  
  2830.     10:5:9  @MatrixSubtract ([matrix_A],[matrix_B])
  2831.  
  2832.             SUBTRACTS matrix B from matrix A, returning matrix C that 
  2833.             is loaded in the Array Area of the cell that contains this 
  2834.             function call.  The format used to load matrix C in the 
  2835.             cell's Array Area is described in Section 10:5:1.  Note, 
  2836.             the parameter '[matrix_A]' refers to the Cell Address of 
  2837.             the cell that contains matrix A. 
  2838.  
  2839.             Requirements:
  2840.  
  2841.                 (i)  Matrix A and B must be the same size.
  2842.  
  2843.             ________________________________________________________
  2844.  
  2845.  
  2846.    10:5:10  @MatrixTranspose ([matrix_A])
  2847.  
  2848.             TRANSPOSES matrix A  (i.e. flips the matrix so that the 
  2849.             rows become the columns and the columns become the rows), 
  2850.             returning matrix C that is loaded in the Array Area of the 
  2851.             cell that contains this function call.  The format used to 
  2852.             load matrix C in the cell's Array Area is described in 
  2853.             Section 10:5:1.  Note, the parameter '[matrix_A]' refers 
  2854.             to the Cell Address of the cell that contains matrix A. 
  2855.  
  2856.  
  2857.  
  2858.  
  2859.     ------------------------------------------------------------------------
  2860.     Section 10:6    MATRIX FUNCTIONS THAT RETURN A SINGLE VALUE
  2861.     ------------------------------------------------------------------------
  2862.  
  2863.     The following two functions return single values that are displayed by
  2864.     the spreadsheet.  As a result, both functions can be nested within
  2865.     other expressions.
  2866.  
  2867.             ________________________________________________________
  2868.  
  2869.  
  2870.     10:6:1  determinant ([matrix_A])
  2871.  
  2872.             Returns the DETERMINANT of matrix A.  Note, the parameter 
  2873.             '[matrix_A]' refers to the Cell Address of the cell that 
  2874.             contains matrix A. 
  2875.  
  2876.             Requirements:
  2877.  
  2878.                 (i)  Matrix A must be a square matrix.
  2879.  
  2880.             ________________________________________________________
  2881.  
  2882.  
  2883.     10:6:2  dotproduct ([matrix_A],[matrix_B])
  2884.  
  2885.             Returns the DOT PRODUCT of matrix A and B (defined as the
  2886.             sum of the products of the corresponding elements).   Note, 
  2887.             the parameter '[matrix_A]' refers to the Cell Address of 
  2888.             the cell that contains matrix A.
  2889.  
  2890.             Requirements:
  2891.  
  2892.                  (i)  The number of rows and the number of columns in
  2893.                       matrix 'A' and matrix 'B' must be equal.
  2894.                 (ii)  Either the number of rows or columns must equal 1,
  2895.                       but not both!
  2896.  
  2897.  
  2898.  
  2899.     ------------------------------------------------------------------------
  2900.     Section 10:7    USING 'NULL' MATRICES
  2901.     ------------------------------------------------------------------------
  2902.  
  2903.     A special variation of the '@Matrix' function allows it to be used with 
  2904.     an empty (or 'null') parameter list.  
  2905.  
  2906.                                @Matrix()
  2907.  
  2908.     The important thing to remember about a NULL MATRIX, is that it is 
  2909.     totally user defined.  That is, it is left to you to create and load the 
  2910.     cell's Array Area with the correct element values.  The @Matrix() 
  2911.     function will neither create or alter the Array Area of a new or 
  2912.     existing cell.  It simply identifies a cell as containing a matrix.  
  2913.     This fact can be taken advantage of when it's necessary to save the 
  2914.     results of a matrix you have computed.  Since the Array Area of an 
  2915.     existing matrix is already setup correctly, all that is necessary to do 
  2916.     to preserve its contents is to enter "@Matrix()" at the Input Line (with 
  2917.     the Cell Pointer positioned over the matrix cell).  This will form a 
  2918.     NULL MATRIX, which removes the matrix operation that was used to compute 
  2919.     the original matrix.  The element values are unaffected. 
  2920.  
  2921.     A NULL MATRIX is also useful when it comes to loading a large matrix 
  2922.     from an external text file (refer to loading 'Text' files in Section 
  2923.     4:3). 
  2924.  
  2925.     REMEMBER, WHEN USING A NULL MATRIX, IT IS UP TO YOU TO MAKE SURE THAT 
  2926.     AN ARRAY AREA FOR THE CELL EXISTS AND THAT IT IS LOADED PROPERLY.  The 
  2927.     following diagram defines how the Array Area of a matrix must be setup. 
  2928.     Notice that the first two entries always contain the number of rows and 
  2929.     columns in the matrix.  These values are followed by the element values 
  2930.     of the first row, the second row, and so on. 
  2931.  
  2932.                      [1]:  number of ROWS in the matrix
  2933.                      [2]:  number of COLUMNS in the matrix
  2934.                      [3]:  first column entry of the first row
  2935.                      [4]:  second column entry of the first row
  2936.                       :
  2937.                      [n]:  last column entry of the last row
  2938.  
  2939.  
  2940.  
  2941.     ------------------------------------------------------------------------
  2942.     Section 10:8    USING MATRICES WITH POINTS, SEGMEMTS, AND POLYGONS
  2943.     ------------------------------------------------------------------------
  2944.  
  2945.     One of the most powerful features of the this package is its ability to 
  2946.     perform repeated @MatrixProduct operations on the coordinates of POINTS, 
  2947.     SEGMENTS, and POLYGONS, forming a new cell (of the same type) that 
  2948.     contains the transformed coordinates. To do this, the spreadsheet views 
  2949.     each coordinate pair as an independent 1X3 matrix (the third element is 
  2950.     always set to 1) that can be multiplied by any 3x3 transformation 
  2951.     matrix.  When doing this, the only rule that must be followed is that 
  2952.     the POINT, SEGMENT, or POLYGON cell must be the A matrix (the first 
  2953.     reference) in the function's parameter list.  As an example, to rotate, 
  2954.     scale, or translate the coordinates of a polygon, the function call 
  2955.     should be setup as follows: 
  2956.  
  2957.             @MatrixProduct ([polygon], [transformation_matrix])
  2958.  
  2959.     When the above operation is performed, a new cell will be created based 
  2960.     on the cell type of the first parameter (in this case a POLYGON) with 
  2961.     each of its coordinates multiplied times the transformation matrix. 
  2962.  
  2963.  
  2964.     ------------------------------------------------------------------------
  2965.     Section 10:9    EXAMPLES
  2966.     ------------------------------------------------------------------------
  2967.  
  2968.  
  2969.  
  2970.         Example 1)   MULTIPLY MATRIX 'A' BY MATRIX 'B'
  2971.  
  2972.                      A = | 2  1  0 |     B = | 1  -1   2 |
  2973.                          | 0  1  1 |         | 1   2   3 |
  2974.                                              | 0   1   1 |
  2975.  
  2976.           Load matrix A into cell [3,2] by entering the the following
  2977.           formula:
  2978.     
  2979.                       @Matrix (2,3, 2,1,0, 0,1,1)
  2980.  
  2981.           Load matrix B into cell [3,4]:
  2982.     
  2983.                       @Matrix (3,3, 1,-1,2, 1,2,3, 0,1,1)
  2984.  
  2985.           To multiply matrix A by B, enter the following function
  2986.           in cell [3,6]:
  2987.  
  2988.                       @MatrixProduct ([3,2],[3,4])
  2989.  
  2990.   
  2991.             To quickly display the elements of the new matrix (C),
  2992.             position the Cell Pointer over cell [3,6] and type
  2993.             a lone equal sign (=) at the Input Line followed by the
  2994.             <Enter> key.  This will cause the first row of the new
  2995.             matrix to be displayed at the Input Line.  Press the
  2996.             <Enter> key again to display the next row, and so on.
  2997.  
  2998.  
  2999.  
  3000.         Example 2)   DISPLAY THE ELEMENTS OF MATRIX 'C' ON THE SCREEN.
  3001.  
  3002.             Locate an area on your worksheet large enough to display
  3003.             the matrix.  In this case, we'll use the range of cells
  3004.             between [5,3] and [6,5].
  3005.  
  3006.             To display matrix C (loaded in cell [3,6]), position the
  3007.             Cell Pointer over cell...
  3008.  
  3009.                         [5,3] and enter:   [3,6,3]
  3010.                         [5,4] and enter:   [3,6,4]
  3011.                         [5,5] and enter:   [3,6,5]
  3012.                         [6,3] and enter:   [3,6,6]
  3013.                         [6,4] and enter:   [3,6,7]
  3014.                         [6,5] and enter:   [3,6,8]
  3015.  
  3016.  
  3017.             IMPORTANT!  Notice that the first element of matrix C is 
  3018.             stored in array position "3" ([3,6,3]) - not position one.  
  3019.             The first two array positions of all cells that contain 
  3020.             matrices are reserved for the number of 'rows' and 
  3021.             'columns' in the matrix (refer back to Section 10:3). 
  3022.  
  3023.             IMPORTANT!  The one problem with displaying a matrix as 
  3024.             just described is that cells [5,3] thru [6,5] will not 
  3025.             update themselves when the element values of matrix C 
  3026.             (cell [3,6]) are changed.  Refer to Section 6:5 for a 
  3027.             detailed explanation as to why this is the case.  To force 
  3028.             these cells to update, you can set the +ReCalc flag 
  3029.             for each of these cells (described in Section 4:1). This 
  3030.             will cause cells [5,3] thru [6,5] to automatically update 
  3031.             their values - each time ANY change is made to the 
  3032.             worksheet. 
  3033.  
  3034.  
  3035.  
  3036.         Example 3)   MODIFY MATRIX 'A' SO THAT 2 OF ITS ELEMENT VALUES
  3037.                      CAN BE SET FROM VALUES ENTERED IN OTHER CELLS.
  3038.  
  3039.             First, enter a value in cell [1,2] and cell [2,2] (any 
  3040.             value).  Then modify the formula in cell [3,2] (matrix A)
  3041.             to read:
  3042.  
  3043.                      @Matrix (3,3,[1,2],1,3,[2,2],5,6)
  3044.  
  3045.             Now, each time you reset the values in cells [1,2] and [2,2]:
  3046.  
  3047.               (i)  the value of matrix A will change 
  3048.              (ii)  matrix A and B will be re-multiplied, updating
  3049.                      the value of matrix C in cell [3,6]
  3050.             (iii)  and, the values displayed in cells [5,3] thru
  3051.                      [6,5] will be updated (provided you set the
  3052.                      +ReCalc flag for these cell).
  3053.                   
  3054.  
  3055.  
  3056.                                               ____________________________
  3057.     _________________________________________/  Chapter 11      SCRIPTS
  3058.  
  3059.  
  3060.  
  3061.  
  3062.     INTRODUCTION
  3063.  
  3064.  
  3065.     Scripts are one of the most powerful features offered by REBEL.  They 
  3066.     extend the power and capabilities of the spreadsheet by allowing you to 
  3067.     tailor functions, utilities, and even full applications to fit your 
  3068.     specific needs.  They are also easy to use. Simply reference the 
  3069.     library that contains the script you want and  REBEL's powerful Script 
  3070.     Manager will handle the rest for you. 
  3071.     
  3072.     REBEL comes with a standard a script library called STDLIB.REB.  While 
  3073.     it contains many useful functions, it's far from complete in terms of 
  3074.     what is possible.  The documentation for this library is included in 
  3075.     a file called STDLIB.DOC. 
  3076.  
  3077.  
  3078.  
  3079.     -----------------------------------------------------------------------
  3080.     Section  11:1   WHAT ARE SCRIPTS?
  3081.     -----------------------------------------------------------------------
  3082.  
  3083.     Scripts are functions or procedures that contain one or more statements 
  3084.     that can be organized and executed in a highly structured manner to 
  3085.     perform a specific task.  The structure or syntax used to write scripts 
  3086.     is very similar to the 'C' programming language.
  3087.     
  3088.     Scripts have several advantages over cell formulas.  They allow you to 
  3089.     control the number and the order in which statements are executed 
  3090.     before returning control to the spreadsheet.  They can also be used as 
  3091.     building blocks to access other scripts and/or a whole set of built-in 
  3092.     'Toolkit' functions that provide a complete interface to every aspect 
  3093.     of the spreadsheet.  And finally, scripts combine the powerful 
  3094.     computational features of a spreadsheet with the flexibility of a 
  3095.     traditional programming language. 
  3096.     
  3097.     In general, scripts are grouped into three major categories: functions, 
  3098.     utilities, and applications. 
  3099.  
  3100.       FUNCTIONS:  While REBEL provides 94 built-in functions that perform 
  3101.       a wide range of spreadsheet computations, there are literally 
  3102.       thousands of other functions (geared to specific industries or 
  3103.       occupations) that could be developed.  Fortunately, REBEL makes it 
  3104.       is easy to add libraries of such routines with a highly structured, 
  3105.       C-like, script language.  These functions (or scripts) look and 
  3106.       behave just like built-in functions and are also automatically 
  3107.       included in REBEL's recalculation engine. 
  3108.  
  3109.       UTILITIES:  Scripts can also be designed to perform specialized 
  3110.       tasks that fall under the same category as most 'macros' (i.e. 
  3111.       utilities).  Scripts of this type usually perform some action or 
  3112.       command currently not available from the Function Key Menus.  As
  3113.       an added option, these scripts can also be assigned and executed
  3114.       from a special set of function keys (see Section 4:5). 
  3115.  
  3116.       APPLICATIONS:  Some scripts become so powerful that they actually 
  3117.       take over control of the spreadsheet itself.  These scripts often 
  3118.       use the spreadsheet only as a powerful computational tool by hiding 
  3119.       the spreadsheet matrix and redesigning the user interface.  This 
  3120.       makes the application easier to learn and less intimidating for
  3121.       the user. 
  3122.  
  3123.  
  3124.     -----------------------------------------------------------------------
  3125.     Section  11:2   USING SCRIPTS
  3126.     -----------------------------------------------------------------------
  3127.  
  3128.     Before a script can be accessed from a library, the name of the library 
  3129.     file must either be 'attached' in REBEL's start up sequence with the -L: 
  3130.     option or attached from within the spreadsheet itself with the 'Attach'
  3131.     Function Key Command discussed in Section 4:5.  Once a library has been
  3132.     referenced in this fashion, REBEL's Script Manager handles the rest for
  3133.     you. 
  3134.  
  3135.     For example, to access the scripts in REBEL's standard library,  
  3136.     STDLIB.REB, simply restart the program using the -L: option (followed 
  3137.     immediately by the name of the library): 
  3138.  
  3139.                               REBEL -L:STDLIB
  3140.   
  3141.     It's that simple!
  3142.     
  3143.  
  3144.     -----------------------------------------------------------------------
  3145.     Section  11:3   THE SCRIPT INDEX
  3146.     -----------------------------------------------------------------------
  3147.  
  3148.     While there is no limit to the number of libraries that can be 
  3149.     attached with the -L: option or with the 'Attach' command, REBEL's 
  3150.     Script Manager will only keep track of the first 64 scripts it 
  3151.     encounters.  It does this by loading information about each script into 
  3152.     a special 'Script Index' as each library file is scanned.  The 
  3153.     information contained in this index is then used by the Script Manager 
  3154.     to manage and execute scripts in a special memory area called the Swap 
  3155.     Area (discussed in more detail in the next section).  The important 
  3156.     thing to remember is that ONLY the scripts found in the Script Index 
  3157.     can be accessed by the Script Manager and that scripts ARE NOT loaded 
  3158.     into the Swap Area until they are actually used in the spreadsheet. 
  3159.  
  3160.     The Script Index contains a great deal of useful information designed 
  3161.     to help you to fine tune your system.  You can inspect its contents 
  3162.     with the 'Index' Function Key Command explained in Section 4:5.  This 
  3163.     command displays the following information about each script: 
  3164.      
  3165.          -  The SIZE of the script in bytes (characters)
  3166.          -  Address of the script within the Swap Area
  3167.          -  The NAME of the library that contains the script
  3168.          -  The library's version number (set by its author)
  3169.          -  The version of the Script Library Builder used to create
  3170.               the library.
  3171.          -  The recommend 'minimum' version of REBEL to use
  3172.  
  3173.     NOTE:  From time to time, it may become necessary to clear the Script 
  3174.     Index to make room for scripts found in other libraries.  This can be 
  3175.     done with the 'Detach' function key command described in Section 4:5 of 
  3176.     this manual. 
  3177.  
  3178.  
  3179.     -----------------------------------------------------------------------
  3180.     Section  11:4   THE SWAP AREA
  3181.     -----------------------------------------------------------------------
  3182.  
  3183.     Before a script can be executed, the Script Manager must copy the body 
  3184.     of the script from a library file to a special memory area called the 
  3185.     Swap Area.  Once loaded, scripts will either remain in this area (where 
  3186.     they can be quickly re-executed) or will be temporarily swapped out to 
  3187.     make room for other scripts that require additional memory.  In either 
  3188.     case, the Script Manager keeps track of what's going on. 
  3189.  
  3190.     If the Script Manager cannot load a script due to insufficient memory, 
  3191.     it will begin swapping out scripts currently not in use.  If enough 
  3192.     memory still cannot be collected after completing this process, the 
  3193.     Script Manager will inform you that the memory in the Swap Area has 
  3194.     been exhausted.  You can correct the problem by increasing the size of 
  3195.     the Swap Area (see NOTE below).   There are two ways to do this. 
  3196.     
  3197.     First, you can reset the size of the Swap Area by restarting the 
  3198.     program using the -M: option (followed immediately by the size of the 
  3199.     Swap Area - in bytes).  For example, a start up sequence that would 
  3200.     attach the scripts contained in library STDLIB.REB and then set the 
  3201.     size of the Swap Area to 2000 bytes would look something like this: 
  3202.  
  3203.  
  3204.                          REBEL -L:STDLIB -M:2000
  3205.  
  3206.  
  3207.     The 'SwpArea' function key command (see Section 4:5) can also be used 
  3208.     to adjust the size of the Swap Area.  This command has the added 
  3209.     advantage of allowing you to set the size of the Swap Area without 
  3210.     exiting the program.
  3211.  
  3212.     While setting the Swap Area to the smallest possible size conserves 
  3213.     memory which can be used for other purposes, it can also slow the 
  3214.     overall performance of recalculations by forcing the system to 
  3215.     continuously swap the same scripts in and out of memory as they are 
  3216.     used.  In general, the larger the Swap Area the faster system will run.  
  3217.     You may want to experiment a little to find the best possible trade off 
  3218.     between memory and performance before deciding on the optimum size of 
  3219.     the Swap Area.
  3220.     
  3221.     NOTE:  You can determine the minimum number of bytes required to run 
  3222.     each script by using the 'Index' Function Key command to inspect the 
  3223.     Script Index.  (The current size of the Swap Area can be displayed 
  3224.     by executing the 'SwpArea' Function Key command and then pressing the 
  3225.     <Enter> key without an entry.)
  3226.  
  3227.  
  3228.     -----------------------------------------------------------------------
  3229.     Section  11:5   TROUBLE SHOOTING
  3230.     -----------------------------------------------------------------------
  3231.  
  3232.     When using a script within a cell formula, several problems can occur 
  3233.     that could cause a series of question marks (??????) to be displayed 
  3234.     by the cell.  The fastest way to determine what may have gone wrong is 
  3235.     to move the Cell Pointer to the cell containing the problem and then 
  3236.     to enter the Edit Mode (see Chapter 5).  This will cause an error 
  3237.     message to be displayed that will hopefully help you solve the problem.  
  3238.     If the error message does not provide you with enough information and 
  3239.     you are sure the problem is being caused by a script, review the 
  3240.     following list of problem scenarios for a possible solution. 
  3241.  
  3242.  
  3243.       ERROR:  "script Swap Area is exhausted"
  3244.  
  3245.          Problem:  The Swap Area may be exhausted, even though it is 
  3246.          larger than the biggest script listed in the Script Index.  
  3247.          This can happen when one script calls another script.  In 
  3248.          case, both scripts are "in use"; and, therefore, can not be 
  3249.          swapped out. 
  3250.           
  3251.          Solution 1:  Use the 'SwpArea' function key command (see 
  3252.          Section 4:5) to increase the size of the Swap Area, a 
  3253.          little at a time, until the script is able to run. 
  3254.  
  3255.  
  3256.       ERROR:  "undefined script or function"
  3257.  
  3258.          Problem:  The spreadsheet is unable to locate the script.
  3259.  
  3260.          Solution 1:  The library containing the script you are
  3261.          attempting to access may not have been properly 'attached'.
  3262.          Try locating the script in the Script Index.  If you can not
  3263.          find it, try re-attaching the library with the 'Attach'
  3264.          Function Key command (refer to Section 4:5). 
  3265.     
  3266.          Solution 2:  The name of the script may not be spelled 
  3267.          correctly.  Remember script names are case sensitive (i.e. 
  3268.          "sum" and "Sum" are not the same). 
  3269.       
  3270.          Solution 3:  You may have 'attached' a series of libraries 
  3271.          that (in combination) total more than 64 scripts.  As a 
  3272.          result the script you are attempting to access may not have 
  3273.          been loaded in the index.  Try clearing the Script Index 
  3274.          with the 'Detach' function key command (Section 4:5) and 
  3275.          re-attaching the library containing the script that you 
  3276.          need - first. 
  3277.  
  3278.  
  3279.       ERROR:  "out of memory"
  3280.     
  3281.          Problem:  Scripts containing locally declared variables 
  3282.          dynamically reserve and then free up a portion of memory 
  3283.          for their own use.  This memory is not part of the Swap 
  3284.          Area.  If a worksheet happens to consume a large amount of 
  3285.          memory, it is possible that these scripts will be unable to 
  3286.          allocate the memory it needs to run. 
  3287.  
  3288.          Solution 1:  Try reducing the size of your worksheet. 
  3289.          Hopefully, this will free up enough memory that the script 
  3290.          will be able to run. 
  3291.  
  3292.  
  3293.       ERROR:  "syntax error"
  3294.  
  3295.          Problem:  As time goes on and new features are added to 
  3296.          REBEL, it will be possible to write scripts that will not 
  3297.          run properly on an older version of REBEL.
  3298.          
  3299.          Solution 1:  Use the 'Index' command to verify that you are 
  3300.          use a version of REBEL that is capable of running the 
  3301.          script in question.  There is no charge to upgrade this 
  3302.          program, if it becomes necessary. 
  3303.     
  3304.  
  3305.  
  3306.     -----------------------------------------------------------------------
  3307.     Section  11:6   WRITING YOUR OWN SCRIPTS
  3308.     -----------------------------------------------------------------------
  3309.  
  3310.  
  3311.  
  3312.     All versions of REBEL 3.0 and higher come with a built-in Script 
  3313.     Manager that can access and execute scripts found in any (.REB) library 
  3314.     file.  Writing and creating these libraries, however, is an optional 
  3315.     feature requiring a license for REBEL's Script Library Builder.  The 
  3316.     cost of this additional software is $29.00 (see Order Form at the end 
  3317.     of this manual). 
  3318.  
  3319.     Because the subjects related to writing scripts are covered extensively 
  3320.     in the documentation that accompanies the Script Library Builder, only 
  3321.     a brief discussion of these topics is included here.  The following 
  3322.     section, therefore, is only intended to be an introduction and is by no 
  3323.     means complete. 
  3324.  
  3325.  
  3326.                     _________________________________
  3327.  
  3328.  
  3329.  
  3330.     One of the first things you'll notice about REBEL's Script Language 
  3331.     (RSL) is that it's a far cry from the 'macro' languages supported by 
  3332.     most spreadsheets.  RSL is a highly structured, C-like programming 
  3333.     language that is both powerful and easy to learn.  And, if you are an 
  3334.     experienced 'C' programmer, you'll find that writing these scripts 
  3335.     is almost second nature.
  3336.  
  3337.     Before going into detail on the specific components that make up a 
  3338.     script, it might be useful to see what an actual script looks like.  
  3339.     For this, let's use the famous "Hello world!" example: 
  3340.  
  3341.  
  3342.  
  3343.          hello (val: row, col)    /* pass in two values - the cursor pos */
  3344.          chr: buffer[80];         /* declare a local string of 80 chars  */
  3345.          {
  3346.            cursor(row,col);                /* position cursor on screen */
  3347.            strcpy(buffer,"Hello world!");  /* save string constant */
  3348.            fputs(buffer,0);                /* write 'string' to screen */
  3349.          }
  3350.  
  3351.  
  3352.  
  3353.     The above example is slightly more complicated than it needs to be to 
  3354.     demonstrate local variable declarations and the parameter passing 
  3355.     features of scripts . 
  3356.  
  3357.     Notice that the first line of the script contains the name of the 
  3358.     script followed by the names of two arguments that are passed to it 
  3359.     from another script or from the worksheet.  These arguments must be 
  3360.     enclosed within a set of parentheses and can include four distinct data 
  3361.     types:  values (val:), arrays (val: []), character strings (chr:), and 
  3362.     cell address pointers (cel:). 
  3363.  
  3364.     Local parameters can also be declared that are only visible while the 
  3365.     script is being executed.  If used, these variables MUST precede the 
  3366.     opening curly brace '{' that begins the body of the script.  This 
  3367.     differs from 'C', where the local parameters follow the opening brace.  
  3368.     There are 3 data types that can be declared locally:  (1)  values, (2) 
  3369.     arrays, and (3) character strings. 
  3370.     
  3371.     The body contains the statements that are executed when the script is 
  3372.     run. It follows the local parameter declarations and is enclosed within 
  3373.     a set of curly braces {}. 
  3374.  
  3375.     RSL supports 3 programming constructs (if, for, while) that can be used 
  3376.     to control the order in which statements are executed. 
  3377.  
  3378.        The 'if-else' construct:
  3379.  
  3380.              if (test) {
  3381.                 statement(s);
  3382.               } else if (test) {
  3383.                 statement(s);
  3384.               } else {
  3385.                 statement(s);
  3386.               }
  3387.  
  3388.  
  3389.        The 'for' construct:
  3390.  
  3391.               for (initialize; test; increment) {
  3392.                   statement(s);
  3393.               }
  3394.  
  3395.            For example:
  3396.  
  3397.               for (ii=0; ii<80; ii+=1) {  /* blank out 'name' */
  3398.                  name[ii] = ' ';
  3399.               }
  3400.  
  3401.  
  3402.        The 'while' construct:
  3403.  
  3404.               while (test) {
  3405.                 statement(s);
  3406.               }
  3407.  
  3408.  
  3409.     RSL also supports:
  3410.  
  3411.               comments  (/* .. */)
  3412.               'break'
  3413.               'continue'
  3414.               'return'
  3415.  
  3416.  
  3417.     TOOLKIT FUNCTIONS
  3418.  
  3419.     In addition to its powerful programming constructs, RSL supports an 
  3420.     extensive set of over 30 Toolkit functions.  These routines are 
  3421.     accessible only to scripts and cannot be used within cell formulas. 
  3422.     They extend a wide range of capabilities that include access to the 
  3423.     primary elements that control the spreadsheet, as well as to I/O and 
  3424.     screen handling routines. 
  3425.  
  3426.     NOTE:  A more detailed description of each of these functions is 
  3427.     included with the documentation accompaniing REBEL's Script Library 
  3428.     Builder. 
  3429.  
  3430.         fopen      -  Opens a text file for read, write, or append access.
  3431.  
  3432.         fclose     -  Closes a file opened by 'fopen'.
  3433.  
  3434.         fgets      -  Reads the first 'n' characters from a text file (or
  3435.                       until an End-of-Line marker is encountered), placing
  3436.                       the characters read into the 'string' parameter. This
  3437.                       routine can also read characters from the keyboard by
  3438.                       setting the 'fp' parameter to zero (0). 
  3439.  
  3440.         fputs      -  Writes the character in the 'string' parameter to a
  3441.                       text file that has been previously opened by 'fopen'.
  3442.                       This function can also be used to write characters to
  3443.                       the screen by setting the 'fp' parameter to zero (0).
  3444.  
  3445.         sprintf    -  Converts and formats an argument list made up of any
  3446.                       number or type of parameters into a character string.
  3447.                       Supports '%s' and '%f' conversions.
  3448.  
  3449.         getchar    -  Returns the ASCII value of the next character returned
  3450.                       from the keyboard.
  3451.  
  3452.         cursor     -  Moves the screen cursor to a specific row and column
  3453.                       position.
  3454.  
  3455.         erase      -  Erases 'n' character on the screen.
  3456.  
  3457.         clear      -  Clears the screen.
  3458.  
  3459.         refresh    -  Re-displays the spreadsheet.
  3460.  
  3461.         drawbox    -  Draws a box of the screen.
  3462.  
  3463.         savework   -  Saves a worksheet in REBEL's native .RB2 format.
  3464.  
  3465.         loadwork   -  Loads a worksheet that has been saved in REBEL's
  3466.                       native .RB2 format.
  3467.  
  3468.         report     -  Copies a portion of a worksheet to a disk file.
  3469.  
  3470.         freework   -  Deletes all data at the specified worksheet level.
  3471.  
  3472.         makentry   -  Makes a cell entry at a specific location.
  3473.  
  3474.         getentry   -  Returns the cell entry (formula) of a cell.
  3475.  
  3476.         contents   -  Returns a copy of the text that is displayed by a cell.
  3477.  
  3478.         recalc     -  Recomputes a cell's formula.
  3479.  
  3480.         purgecell  -  Purges (deletes) a cell from the worksheet.
  3481.  
  3482.         copycell   -  Copies a cell to another location.
  3483.  
  3484.         movecell   -  Moves a cell to another location on the spreadsheet.
  3485.  
  3486.         nextcol    -  Returns the column that contains the next occupied
  3487.                       cell.
  3488.  
  3489.         nextrow    -  Returns the next row that contains data.
  3490.  
  3491.         lastrow    -  Returns the last row at a level that contains data.
  3492.  
  3493.         gocell     -  Moves the Cell Pointer to any location on the
  3494.                       worksheet.
  3495.  
  3496.         cprow      -  Returns the row number of the Cell Pointer's current
  3497.                       position.
  3498.  
  3499.         cpcol      -  Returns the column number of the Cell Pointer's current
  3500.                       position.
  3501.  
  3502.         cplvl      -  Returns the level number of the Cell Pointer's current
  3503.                       position.
  3504.  
  3505.         cprng      -  Allows the Cell Pointer to be moved from within a
  3506.                       script.
  3507.  
  3508.         cwidth     -  Returns (or sets) the width of a specific column.
  3509.  
  3510.         attribute  -  Returns an attribute setting of a cell, given the
  3511.                       attribute's id number. In all, over 20 attribute
  3512.                       settings can be viewed or modified.
  3513.  
  3514.         seterrno   -  Clears or sets the 'errno' flag value.
  3515.  
  3516.         errno      -  Returns the value of the 'errno' flag.
  3517.  
  3518.         errlist   -   Returns a system error message.
  3519.  
  3520.  
  3521.  
  3522.                                              _____________________________
  3523.     ________________________________________/  Appendix  A    SUPPORT
  3524.  
  3525.  
  3526.  
  3527.      
  3528.     If you have a question regarding this manual or feel the program has a
  3529.     bug, please don't hesitate to contact me.  I'll make every effort to
  3530.     respond to your questions as soon as possible.  Please include the
  3531.     following information: 
  3532.      
  3533.      
  3534.         (1)  version of REBEL (3.0)
  3535.         (2)  DOS Version (3.1, 5.0)
  3536.         (3)  Computer Model (IBM)
  3537.         (4)  Processor Type (286, 386)
  3538.         (5)  Monitor Type (CGA,VGA)
  3539.         (6)  Memory Size (640K)  
  3540.      
  3541.         (7)  A  simple example that isolates the problem.
  3542.         (8)  Any error messages  displayed when entering the Edit Mode.
  3543.         (9)  The exact steps required to reproduce the problem.
  3544.        (10)  If possible, a floppy disk that contains the problem.
  3545.      
  3546.  
  3547.      Send to:
  3548.                 Brad L. Smith
  3549.                 REBEL Software
  3550.                 P.O. Box 270277
  3551.                 Fort Collins, CO  80527
  3552.  
  3553.      Phone:
  3554.  
  3555.               (303) 223-1882  (I cannot return long distance calls)
  3556.  
  3557.  
  3558.  
  3559.                                              _____________________________
  3560.     ________________________________________/  Appendix  B    LICENSE
  3561.  
  3562.  
  3563.  
  3564.  
  3565.                               LICENSE AGREEMENT
  3566.  
  3567.  
  3568.     You are hereby granted a non-exclusive license to use REBEL under the
  3569.     following conditions: 
  3570.      
  3571.     You may:
  3572.      
  3573.       a. use the software on as many computers as you like.
  3574.       b. copy the software and disk resident documentation.
  3575.       c. distribute unmodified copies of the software and disk resident
  3576.          documentation provided you:  1)  include, at a minimum, the
  3577.          following files:  REBEL.EXE, CHAP1-4.DOC, CHAP5-11.DOC,
  3578.          STDLIB.REB, STDLIB.DOC;  and  2) receive no payment for this
  3579.          product, other than for the transfer medium.
  3580.       d. include the software and disk resident documentation with other
  3581.          products or services provided REBEL's trademark is clearly
  3582.          identified and the minimum files (described above) are included.
  3583.     
  3584.     You may NOT:
  3585.      
  3586.       a. copy or distribute, by any means, the printed documentation
  3587.          furnished with this product.
  3588.       b. modify or reverse engineer the software.
  3589.      
  3590.     The software described in this document (REBEL.EXE) is protected by
  3591.     copyright laws.  It is not in the public domain.  Its author (Brad L.
  3592.     Smith) retains full ownership of the copy you have received and your
  3593.     rights to use REBEL automatically terminate if you fail to comply with
  3594.     any provision of this License Agreement.  
  3595.      
  3596.      
  3597.     Note:   The Script Library Builder (BUILD.EXE) is not part of this
  3598.     product.  Under no circumstances may this program be copied or
  3599.     distributed. 
  3600.  
  3601.  
  3602.  
  3603.  
  3604.      
  3605.      
  3606.      
  3607.                              WARRANTY DISCLAIMER
  3608.      
  3609.  
  3610.  
  3611.     THIS SOFTWARE AND MANUAL IS LICENSED "AS IS" AND WITHOUT ANY EXPRESSED
  3612.     OR IMPLIED WARRANTIES WHATSOEVER.  THE USER MUST ASSUME THE ENTIRE
  3613.     RISK:  1) OF USING THIS PRODUCT,  2) OF ANY DAMAGES RESULTING FROM ITS
  3614.     USE, AND  3) FOR ITS FITNESS FOR ANY PARTICULAR PURPOSE.  UNDER NO
  3615.     CIRCUMSTANCE, WILL LIABILITY EXCEED THE ORIGINAL PURCHASE PRICE OF THE
  3616.     LICENSED PROGRAM, REGARDLESS OF THE FORM OF CLAIM. 
  3617.      
  3618.     Some states do not allow exclusion of the limit of liability for
  3619.     consequential or incidental damages, so the above limitation may not
  3620.     apply to you. 
  3621.      
  3622.     This agreement shall be governed by the laws of the State of Colorado.
  3623.     Any action or proceeding brought by either party against the other
  3624.     arising out of or related to this agreement shall be brought only in a
  3625.     STATE or FEDERAL COURT of competent jurisdiction located in the State
  3626.     of Colorado.  The parties hereby consent to in personam jurisdiction of
  3627.     said courts. 
  3628.  
  3629.  
  3630.  
  3631.  
  3632.                                  ORDER FORM
  3633.  
  3634.                         (AVALIABLE ONLY ON 3.5" DISKS)
  3635.  
  3636.  
  3637.       Name (required): __________________________________________________
  3638.  
  3639.       Title (optional): _________________________________________________
  3640.  
  3641.       Company (optional): _______________________________________________
  3642.  
  3643.       Address:  _________________________________________________________
  3644.  
  3645.       City:  _____________________________  State: ____  Zip:  __________
  3646.  
  3647.       Phone: ___________________ (Day) 
  3648.  
  3649.  
  3650.       Your current version of REBEL: ____________________________________
  3651.  
  3652.       Your current version of the Script Library Builder: _______________
  3653.  
  3654.       Where did you here about this product? _____________________________
  3655.  
  3656.  
  3657.  
  3658.  
  3659.       REBEL   (without a printed manual)      ($4.00)         ____________
  3660.  
  3661.           (Add $10 for a printed User's Manual)
  3662.  
  3663.  
  3664.       SCRIPT LIBRARY BUILDER:                 ($29.00)        ____________
  3665.  
  3666.           (Add $10 for a printed manual for REBEL)
  3667.  
  3668.           Note:  Be sure to include the name of the
  3669.           individual to be licensed.  Do not use a
  3670.           company name.
  3671.  
  3672.  
  3673.       SCRIPT LIBRARY BUILDER  (upgrade)        ($19.00)       ____________
  3674.  
  3675.           License No. ______________________
  3676.  
  3677.  
  3678.       SHIPPING AND HANDLING    (U.S.A - $6.00)                ____________
  3679.  
  3680.           (Canada - $12.00, Overseas - $20.00)
  3681.  
  3682.  
  3683.                                     TOTAL (in US currency):   ____________
  3684.  
  3685.  
  3686.  
  3687.        REBEL SOFTWARE  -  P.O. Box 270277  -  Fort Collins, CO  -  80527
  3688.