home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / business / rebel30.zip / CHAP5-11.DOC < prev    next >
Text File  |  1993-03-10  |  180KB  |  3,753 lines

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