home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 February / PCWorld_2000-02_cd.bin / Software / Servis / FFE / SPREADSH.SWG / 0004_Lotus WKS.pas / LOTUS.ZIP / LOTUS.DOC
Encoding:
Text File  |  1997-05-04  |  112.9 KB  |  3,186 lines

  1.  
  2.                             WORKSHEET FILE FORMAT
  3.                                   FROM LOTUS
  4.  
  5.                        INTRODUCTION AND QUICK REFERENCE
  6.  
  7.                Copyright(c) 1984, Lotus Development Corporation
  8.                                161 First Street
  9.                         Cambridge, Massachusetts 02142
  10.                                 (617) 492-7171
  11.                       Electronic Edition, December, 1984
  12.                              All Rights Reserved
  13.  
  14.  PREFACE
  15.  
  16.  Lotus Development Corporation's 1-2-3(TM) and Symphony(TM) perform user
  17.  selected operations upon a data matrix that is termed a "worksheet".
  18.  
  19.  Worksheet files are such matrices stored on disk.
  20.  
  21.  A worksheet file is an unbroken sequence of binary coded records defining a
  22.  single worksheet.
  23.  
  24.  Both 1-2-3 and Symphony accept externally created data files if the files
  25.  are in the worksheet file format.  Other programs can decode and process
  26.  worksheet files created by 1-2-3 or Symphony.
  27.  
  28.  The following document provides information required to create or access a
  29.  worksheet file by describing the records used to create a worksheet file.
  30.  It is assumed that the reader is familiar with Lotus products and has ready
  31.  access to 1-2-3 or Symphony documentation.
  32.  
  33.  Note that the worksheet files for 1-2-3 and Symphony are similar, but not
  34.  necessarily interchangeable.  1-2-3 and Symphony share some record types,
  35.  but also have record types unique to that product.  Symphony can read 1-2-3
  36.  records, but 1-2-3 cannot read Symphony records.
  37.  
  38.  The information contained in this document has been released into the
  39.  public domain and is not considered to be confidential or proprietary
  40.  although still the copyright and property of Lotus Development Corporation.
  41.  All efforts have been made to ensure that this information is clear and
  42.  useful since Lotus will not be providing customer assistance with this
  43.  booklet.  Lotus will, however, incorporate any necessary corrections if
  44.  they are reported in writing to:
  45.  
  46.                         Lotus Development Corporation
  47.                         Worksheet File Format
  48.                         161 First Street
  49.                         Cambridge, MA 02142
  50.  
  51.  
  52.  
  53.  WORKSHEET FILE FORMAT
  54.  
  55.  Worksheet files are organized as an unbroken sequence of variable length
  56.  binary records.  Each record consists of a 4-byte header followed by the
  57.  record body. The header defines the record's type and length, as the
  58.  example below shows.
  59.  
  60.  The header's composition is as follows:
  61.  
  62.  
  63.  
  64.  Byte Number               Byte Description
  65.  0,1                       Record type code
  66.  2,3                       Record body length (bytes)
  67.  
  68.  
  69.  Example: Record Header
  70.  
  71.                                Record Header
  72.  
  73.                            Record         Record
  74.                             Type          Length
  75.  
  76.           Byte Number      0    1         2    3
  77.              Hex Code     1C   00        20   00
  78.    Decimal Equivalent       28             32
  79.  
  80.  
  81.  The record body can be of many different types; most have predetermined
  82.  length, but some vary in length.
  83.  
  84.  The record type code is 28.
  85.  
  86.  In a hex dump of the file, the record type appears as 1C 00h, noting that
  87.  the 8086/88 stores the most significant byte of word in the higher memory
  88.  address.
  89.  
  90.  The record length is 32 bytes.
  91.  In a hex dump of the file, the record length appears as 20 00h.
  92.  
  93.  
  94.  Record types with Column/Row Coordinates
  95.  
  96.  Some record types contain column/row coordinates to identify a cell, or one
  97.  of the two points that define a range.  Numbering starts at zero in the
  98.  upper left corner of the worksheet.
  99.  For example:
  100.  
  101.                              Cell A1 = column 0, row 0
  102.  
  103.  SUMMARY OF RECORD TYPES
  104.  
  105.  This section describes the different record types found in 1-2-3 and
  106.  Symphony.
  107.  
  108.  There are to Quick Reference tables ordered by Opcode and by Product,
  109.  followed by a detailed reference section ordered by Opcode.  In the
  110.  reference section, there are examples for the more commonly used records.
  111.  
  112.  It is assumed that the reader is familiar with 1-2-3 or Symphony and has
  113.  access to Lotus' documentation.
  114.  
  115.  Quick Reference by Opcode
  116.  
  117.  Type       Code (hex)        Length (bytes)         Description
  118.  
  119.  BOF            0                2                   Beginning of file
  120.  EOF            1                0                   End of file
  121.  CALCMODE       2                1                   Calculation mode
  122.  CALCORDER      3                1                   Calculation order
  123.  SPLIT          4                1                   Split window type
  124.  SYNC           5                1                   Split window sync
  125.  RANGE          6                8                   Active worksheet range
  126.  WINDOW1        7                31                  Window 1 record
  127.  COLW1          8                3                   Column width,
  128.                                                        window 1
  129.  WINTWO         9                31                  Window 2 record
  130.  COLW2          A                3                   Column width,
  131.                                                        window 2
  132.  NAME           B                24                  Named range
  133.  BLANK          C                5                   Blank cell
  134.  INTEGER        D                7                   Integer number cell
  135.  NUMBER         E                13                  Floating point number
  136.  LABEL          F                variable            Label cell
  137.  FORMULA        10               variable            Formula cell
  138.  TABLE          18               25                  Data table range
  139.  ORANGE         19               25                  Query range
  140.  PRANGE         1A               8                   Print range
  141.  SRANGE         1B               8                   Sort range
  142.  FRANGE         1C               8                   Fill range
  143.  KRANGE1        1D               9                   Primary sort key range
  144.  HRANGE         20               16                  Distribution range
  145.  KRANGE2        23               9                   Secondary sort key
  146.                                                        range
  147.  PROTEC         24               1                   Global protection
  148.  FOOTER         25               242                 Print footer
  149.  HEADER         26               242                 Print header
  150.  SETUP          27               40                  Print setup
  151.  MARGINS        28               10                  Print margins code
  152.  
  153.  Quick Reference by Opcode (continued)
  154.  
  155.  Type         code (hex)       Length (bytes)        Description
  156.  
  157.  LABELFMT        29                  1               Label alignment
  158.  TITLES          2A                  16              Print borders
  159.  GRAPH           2D                  437             Current graph settings
  160.  NGRAPH          2E                  453             Named graph settings
  161.  CALCCOUNT       2F                  1               Iteration count
  162.  UNFORMATTED     30                  1               Formatted/unformatted
  163.                                                        print
  164.  CURSORW12       31                  1               Cursor location
  165.  WINDOW          32                  144             Symphony window
  166.                                                        settings
  167.  STRING          33                  variable        Value of string
  168.                                                        formula
  169.  PASSWORD        37                  4               File lockout (CHKSUM)
  170.  LOCKED          38                  1               Lock flag
  171.  QUERY           3C                  127             Symphony query
  172.                                                        settings
  173.  QUERYNAME       3D                  16              Query name
  174.  PRINT           3E                  679             Symphony print record
  175.  PRINTNAME       3F                  16              Print record name
  176.  GRAPH2          40                  499             Symphony graph
  177.                                                        record
  178.  GRAPHNAME       41                  16              Graph record name
  179.  ZOOM            42                  9               Orig coordinates
  180.                                                        expanded window
  181.  SYMSPLIT        43                  2               Nos. of split windows
  182.  NSROWS          44                  2               Nos. of screen rows
  183.  NSCOLS          45                  2               Nos. of screen columns
  184.  RULER           46                  25              Named ruler range
  185.  NNAME           47                  25              Named sheet range
  186.  ACOMM           48                  65              Autoload.comm code
  187.  AMACRO          49                  8               Autoexecute macro
  188.                                                        address
  189.  PARSE           4A                  16              Query parse
  190.                                                        information
  191.  
  192.  
  193.  Quick Reference by Product: 1-2-3 only
  194.  
  195.  Type          Code (hex)         Length (bytes)     Description
  196.  
  197.  SPLIT            4                    1             Split window type
  198.  SYNC             5                    1             Split window sync
  199.  WINDOW 1         7                    31            Window 1 record
  200.  WINTWO           9                    31            Window 2 record
  201.  COLW2            A                    3             Column width,
  202.                                                        window 2
  203.  NAME             B                    24            Named range
  204.  QRANGE           19                   25            Query range
  205.  PRANGE           1A                   8             Print range
  206.  SRANGE           1B                   8             Sort range
  207.  KRANGE1          1D                   9             Primary sort key range
  208.  KRANGE2          23                   9             Secondary sort key
  209.                                                        range
  210.  FOOTER           25                   242           Print footer
  211.  HEADER           26                   242           Print header
  212.  SETUP            27                   40            Print setup
  213.  MARGINS          28                   10            Print margins code
  214.  TITLES           2A                   16            Print borders
  215.  GRAPH            2D                   437           Current graph settings
  216.  NGRAPH           2E                   453           Named graph settings
  217.  
  218.  
  219.  
  220.  
  221.  Quick Reference by Product: 1-2-3 and Symphony
  222.  
  223.  Type          Code (hex)         Length (bytes)     Description
  224.  
  225.  BOF               0                   2             Beginning of file
  226.  EOF               1                   0             End of file
  227.  CALCMODE          2                   1             Calculation mode
  228.  CALCORDER         3                   1             Calculation order
  229.  RANGE             6                   8             Active worksheet range
  230.  COLW1             8                   3             Column width
  231.  BLANK             C                   5             Blank cell
  232.  INTEGER           D                   7             Integer number cell
  233.  NUMBER            E                   13            Floating point number
  234.  LABEL             F                   variable      Label cell
  235.  FORMULA           10                  variable      Formula cell
  236.  TABLE             18                  25            Data table range
  237.  FRANGE            1C                  8             Fill range
  238.  HRANGE            20                  16            Distribution range
  239.  PROTEC            24                  1             Global protection
  240.  LABELFMT          29                  1             Label alignment
  241.  CALCCOUNT         2F                  1             Iteration count
  242.  UNFORMATTED       30                  1             Formatted/unformatted
  243.                                                        print
  244.  CURSORW12         31                  1             Cursor location
  245.  
  246.  
  247.  Quick Reference by Product: Symphony only
  248.  
  249.  Type          Code (hex)        Length (bytes)      Description
  250.  
  251.  WINDOW           32                 144             Symphony window
  252.                                                        settings
  253.  STRING           33                 variable        Value of string
  254.                                                        formula
  255.  PASSWORD         37                 4               File lockout (CHKSUM)
  256.  LOCKED           38                 1               Lock flag
  257.  QUERY            3C                 127             Symphony query
  258.                                                        settings
  259.  QUERYNAME        3D                 16              Query name
  260.  PRINT            3E                 679             Symphony print record
  261.  PRINTNAME        3F                 16              Print record name
  262.  GRAPH2           40                 499             Symphony graph
  263.                                                        record
  264.  GRAPHNAME        41                 16              Graph rocord name
  265.  ZOOM             42                 9               Orig coordinates
  266.                                                        expanded window
  267.  SYMSPLIT         43                 2               Nos. of split windows
  268.  NSROWS           44                 2               Nos. of screen rows
  269.  NSCOLS           45                 2               Nos. of screen columns
  270.  RULER            46                 25              Named ruler range
  271.  NNAME            47                 25              Named sheet range
  272.  ACOMM            48                 65              Autoload. comm code
  273.  AMACRO           49                 8               Autoexecute macro
  274.                                                        address
  275.  PARSE            4A                 16              Query parse
  276.                                                        information
  277.  
  278.                             WORKSHEET FILE FORMAT
  279.                                   FROM LOTUS
  280.  
  281.                            SUMMARY OF RECORD TYPES
  282.  
  283.                Copyright(c) 1984, Lotus Development Corporation
  284.                                161 First Street
  285.                         Cambridge, Massachusetts 02142
  286.                                 (617) 492-7171
  287.                       Electronic Edition, December, 1984
  288.                              All Rights Reserved
  289.  
  290.  
  291.                                      BOF
  292.  
  293.  Record Type      Code            Body length
  294.  BOF              0 (00H)         2 bytes
  295.  
  296.  Record Description
  297.  
  298.  Beginning of file
  299.  
  300.  Used by both 1-2-3 and Symphony.
  301.  
  302.  Byte Number       Byte Description
  303.  0-1               file format revision number
  304.                    1028 (0404h) = 1-2-3 file
  305.                    1029 (0405h) = Symphony file
  306.  
  307.  
  308.  Example
  309.  
  310.                            Record Header             Record Body
  311.  
  312.                         Record        Record              BOF
  313.                          Type         Length
  314.  Byte Number            0    1        2    3             0   1
  315.     Hex Code           00   00       02   00            04  04
  316.  Dec.Equivalent           0             2                1028
  317.  
  318.  
  319.                                      EOF
  320.  
  321.  Record Type               Code              Body length
  322.  EOF                       1 (01H)           0 bytes
  323.  
  324.  Record Description
  325.  
  326.  End of file
  327.  
  328.  Used by both 1-2-3 and Symphony
  329.  
  330.  Byte Number          Byte Description
  331.  
  332.  -no record body-
  333.  
  334.  Example
  335.                            Record Header
  336.  
  337.                       Record          Record
  338.                        Type           Length
  339.       Byte Number     0    1          2    3
  340.         Hex Code     01    00        00   00
  341.  Decimal Equivalent     1               0
  342.  
  343.  Note: End of file is ony a header. EOF has a record
  344.  length of 0; therefore, no record body follows.
  345.  
  346.                                    CALCMODE
  347.  
  348.  Record Type            Code             Body length
  349.  
  350.  CALCMODE               2 (02h)          1 byte
  351.  
  352.  Record Description
  353.  
  354.  Calculation method
  355.  
  356.  Used by both 1-2-3 and Symphony.
  357.  
  358.  Byte Number            Byte Description
  359.  
  360.  0                      0 = Manual mode
  361.                         FF = automatic
  362.  
  363.  
  364.  
  365.  
  366.  
  367.                                   CALCORDER
  368.  
  369.  
  370.  Recrod Type            Code                  Body length
  371.  CALCORDER              3 (03H)               1 BYTE
  372.  
  373.  Record Description
  374.  
  375.  Calculation order
  376.  
  377.  Used by both 1-2-3 and Symphony
  378.  
  379.  Byte Number            Byte Description
  380.  0                      0 = natural
  381.                         1 = by column
  382.                         FF = by row
  383.  
  384.  
  385.  
  386.                                     SPLIT
  387.  
  388.  Record Type            Code                  Body length
  389.  SPLIT                  4(04h)                1 byte
  390.  
  391.  Record Description
  392.  
  393.  Split window type
  394.  Used in 1-2-3 only.
  395.  
  396.  Byte Number            Byte Description
  397.  
  398.  0                      0 = not split
  399.                         1 = vertical split
  400.                         FF = horizontal split
  401.  
  402.                                      SYNC
  403.  
  404.  Record Type            Code                  Body length
  405.  SYNC                   5(05h)                1 byte
  406.  
  407.  Record Description
  408.  
  409.  Split window sync
  410.  
  411.  This determines whether the two screens in 1-2-3's split-screen feature
  412.  will move together with the cursor.
  413.  
  414.  Used in 1-2-3 only.
  415.  
  416.  Byte Number            Byte Description
  417.  
  418.  0                      0 = not synchronized
  419.                         FF = synchronized
  420.  
  421.  
  422.                                     RANGE
  423.  
  424.  
  425.  Record Type         Code            Body length
  426.  RANGE               6(06h)          8 bytes
  427.  
  428.  Record Description
  429.  
  430.  Range of cells written to worksheet file.
  431.  If the worksheet file was created using a File Save command, then this
  432.  range describes the active area with trailing blank columns and rows
  433.  removed.  If the worksheet file was created using a File Xtract command,
  434.  then this range describes the extract range with trailing blank columns and
  435.  rows removed.  If there is no data in the range, the starting column is set
  436.  to -1.
  437.  
  438.  Used by both 1-2-3 and Symphony.
  439.  
  440.  Byte Number            Byte Description
  441.  
  442.  0-1                    starting column
  443.  2-3                    starting row
  444.  4-5                    ending column
  445.  6-7                    ending row
  446.  
  447.  Example
  448.  
  449.                    Record Header                    Record Body
  450.                   Record  Record       Starting  Starting  Ending  Ending
  451.                    Type   Length       Column      Row     Column    Row
  452.  Byte Number      0    1   2   3       0     1    2    3    4   5   6   7
  453.     Hex Code     06   00  08  00      00    00   00   00   01  00  03  00
  454.  Dec.Equivalent     6       8             0         0         1       3
  455.  
  456.  The record displays the worksheet range as A1...B4.
  457.  
  458.                                    WINDOW1
  459.  
  460.  Record Type             Code              Body length
  461.  WINDOW1                 7(07h)            31 bytes
  462.  
  463.  Record Description
  464.  
  465.  Window 1 record
  466.  Used in 1-2-3 only.
  467.  
  468.  Byte Number              Byte Description
  469.  
  470.  0-1                      cursor column position
  471.  2-3                      cursor row position
  472.  4                        format (see Appendix A, Cell Format Encoding)
  473.  5                        unused (0)
  474.  6-7                      column width
  475.  8-9                      number of columns on screen
  476.  10-11                    number of rows on screen
  477.  12-13                    left column
  478.  14-15                    top row
  479.  16-17                    number of title columns
  480.  18-19                    number of title rows
  481.  20-21                    left title column
  482.  22-23                    top title row
  483.  24-25                    border width column
  484.  26-27                    border width row
  485.  28-29                    window width
  486.  30                       unused (0)
  487.  
  488.  
  489.  
  490.                                     COLW1
  491.  
  492.  Record Type          Code            Body length
  493.  COLW1                8(08h)          3 bytes
  494.  
  495.  Record Type Description
  496.  
  497.  Column width
  498.  Used by both 1-2-3 and Symphony.
  499.  
  500.  In 1-2-3, this record contains the width of a column Window 1.
  501.  In symphony, it contains width information for the Window Record that it
  502.  follows.
  503.  
  504.  Byte Number          Byte Description
  505.  0-1                  column
  506.  2                    width
  507.  
  508.                                     WINTWO
  509.  
  510.  Record Type          Code           Body length
  511.  WINTWO               9(09h)         31 bytes
  512.  
  513.  Record Description
  514.  Window 2 record
  515.  Used in 1-2-3 only.
  516.  
  517.  Byte Number          Byte Description
  518.  
  519.  0-1                  cursor column position
  520.  2-3                  cursor row position
  521.  4                    format (see Appendix A, Cell Format Encoding)
  522.  5                    unused (0)
  523.  6-7                  column width
  524.  8-9                  number of columns on screen
  525.  10-11                number of rows on screen
  526.  12-13                left column
  527.  14-15                top row
  528.  16-17                number of title columns
  529.  18-19                number of title rows
  530.  20-21                left titile column
  531.  22-23                top title row
  532.  24-25                border width column
  533.  26-27                border width row
  534.  28-29                window width
  535.  30                   unused (0)
  536.  
  537.  
  538.  
  539.  
  540.                                     COLW2
  541.  
  542.  Record Type        Code          Body length
  543.  COLW2              10(0Ah)       3 bytes
  544.  
  545.  Record Description
  546.  Column width, Window 2
  547.  Used in 1-2-3 only.
  548.  
  549.  Byte Number        Byte Description
  550.  0-1                column
  551.  2                  width
  552.  
  553.                                      NAME
  554.  
  555.  Record Type        Code         Body length
  556.  NAME               11 (OBh)     24 bytes
  557.  
  558.  Record Description
  559.  
  560.  Name of range
  561.  The worksheet contains one record for each range name.
  562.  Used in 1-2-3 only.
  563.  
  564.  Byte Number        Byte Description
  565.  0-15               NULL terminated ASCII string
  566.  16-17              Starting column
  567.  18-19              Starting row
  568.  20-21              Ending column
  569.  22-23              Ending row
  570.  
  571.  Example
  572.  
  573.                            Record Header
  574.                         Record      Record
  575.                          Type       Length
  576.  Byte Number            0    1      2    3
  577.  Hex Code              0B   00     18   00
  578.  Decimal Equivalent       11          24
  579.  
  580.  
  581.  
  582.                            Record Body
  583.                         Range Name (Text)
  584.             Decimal Equivalent Expressed in ASCII Text
  585.       0  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15
  586.      52 45 56 45 4E 55 45 53 00 00  00  00  00  00  00  00
  587.      R  E  V  E  N  U  E  S /    Unfilled  Names   Area
  588.  
  589.  
  590.  
  591.                            Record Body
  592.  
  593.                 Starting  Starting  Ending  Ending
  594.                 Column      Row     Column    Row
  595.                 16  17     18  19   20  21  22  23
  596.                 00  00     00  00   01  00  03  00
  597.                    0         0        1        3
  598.  
  599.  Range name is REVENUES (encompasses A1 to B4).
  600.  
  601.                                     BLANK
  602.  
  603.  Record Type        Code           Body length
  604.  BLANK              12(0Ch)        5 bytes
  605.  
  606.  Record Description
  607.  
  608.  Blank cell
  609.  
  610.  Blank cell records appear only for those cells that are protected, or do
  611.  not have the default format.
  612.  
  613.  Unprotected blank cells with the default format are omitted from the
  614.  worksheet file.
  615.  
  616.  Used by both 1-2-3 and Symphony.
  617.  
  618.  Byte Number        Byte Description
  619.  0                  format (see Appendix A, Cell Format Encoding)
  620.  1-2                column
  621.  3-4                row
  622.  
  623.  Example
  624.  
  625.                       Record Header              Record Body
  626.                   Record         Record
  627.                    Type          Length      Format    Column     Row
  628.  Byte Number      0    1         2    3         0      1    2    3   4
  629.  Hex Code        0C   00        05   00        22     05   00   0A  00
  630.  Dec. Equivalent    12             5           34        5        10
  631.  
  632.  This record displays cell in location F11 (column 5, row 10).
  633.  
  634.                                    INTEGER
  635.  
  636.  Record Type          Code             Body length
  637.  INTEGER              13(ODh)          7 bytes
  638.  
  639.  Record Description
  640.  
  641.  Integer number cell
  642.  
  643.  An integer cell holds a single integer value
  644.  in the range -32767....+32767 (decimal).
  645.  
  646.  Used by both 1-2-3 and Symphony.
  647.  
  648.  Byte Number          Byte Description
  649.  
  650.  0                    format (see Appendix A, Cell Format Encoding)
  651.  1-2                  column
  652.  3-4                  row
  653.  5-6                  integer value
  654.  
  655.  
  656.  Example
  657.  
  658.                   Record Header                      Record Body
  659.                 Record     Record
  660.                  Type      Length         Format   Column    Row    Integer
  661.  Byte Number    0    1     2    3            0     1    2    3  4    5   6
  662.  Hex Code      0D   00    07   00           00    00   00   00 00   DD  04
  663.  Dec. Equivalent  13        7                0       0        0      1245
  664.  
  665.  This example displays the integer 1245 located in cell A1 (column 0, row
  666.  0).  When reading a 2-byte integer, the lower byte appears first.  For
  667.  example, DD04h is actually 04DDh (1245 decimal).
  668.  
  669.                                     NUMBER
  670.  
  671.  Record Type        Code        Body length
  672.  NUMBER             14 (0Eh)    13 bytes
  673.  
  674.  Record Description
  675.  
  676.  Floating point number
  677.  Used by both 1-2-3 and Symphony
  678.  
  679.  Byte Number          Byte Description
  680.  
  681.  0                    format
  682.  1-2                  column
  683.  3-4                  row
  684.  5-12 value           (IEEE long real; 8087 double-precision floating-
  685.                       point format)
  686.  
  687.  Example
  688.  The following describes a 64-bit long real format.
  689.  
  690.  
  691.                    S           Exponent           Fraction
  692.                   63          62      52          51       0
  693.                   MSB                                    LSB
  694.  
  695.  S                1-bit Sign field
  696.                   0 = +
  697.                   1 = -
  698.  
  699.  Exponent         11-bit Exponent field
  700.  
  701.                   Exponent is binary, excess 1023(base 10).  Thus, the true
  702.                   exponent is: 2^(exponent -1023).
  703.  
  704.  Fraction         52-bit Fraction field
  705.  
  706.                   An implied leading 1 bit is at the beginning of the
  707.                   fraction.  The implied binary point is between the implied
  708.                   1 bit and the Most  Significant Bit (MSB) of the fraction
  709.                   field.
  710.  
  711.  Special             NA:  S = 1 Exponent = 7FF Fraction = 0
  712.  Values             ERR:  S = 0 Exponent = 7FF Fraction = 0
  713.  
  714.                  STRING:  S = 0 Exponent = 7FF Fraction = non-zero
  715.                                                (Symphony only)
  716.  
  717.                                     LABEL
  718.  
  719.  Record Type        Code           Body  length
  720.  LABEL              15(0Fh)        variable
  721.  
  722.  Record Description
  723.  
  724.  Label cell
  725.  Used by both 1-2-3 and Symphony.
  726.  
  727.  Byte Number        Byte Description
  728.  
  729.  0                  format (see Appendix A, Cell Format Encoding)
  730.  1-2                column
  731.  3-4                row
  732.  5+                 NULL terminated ASCII string;
  733.                     240 bytes maximum
  734.  
  735.  
  736.  Example
  737.  
  738.                 Record Header                     Record Body
  739.                Record   Record
  740.                 Type    Length      Format  Column  Row        Label
  741.  Byte Number    0  1     2  3          0     1  2   3  4   5  6  7  8  9 10
  742.  Hex Code      0F 00    0B 00         F5    00 00  00 00  27 50 41 55 4C 00
  743.  Dec. Equivalent 15       11         245      0      0       P  A  U  L
  744.  
  745.  This example is a label record located at A1 (column 0, row 0).
  746.  
  747.  This record contains the word 'PAUL.
  748.  Byte 5 is always one of the following format prefixes:\'"^.
  749.  
  750.  This record varies in relation to the amount of text stored in the cell.
  751.  
  752.  A user can enter up to 240 characters in one cell.
  753.  
  754.                                    FORMULA
  755.  
  756.  Record Type         Code            Body length
  757.  FORMULA             16(10H)         variable
  758.  
  759.  Record Description
  760.  
  761.  Formula cell
  762.  
  763.  Used by both 1-2-3 and Symphony.
  764.  
  765.  Formulas are compiled in Reverse Polish Internal Notation.  By creating
  766.  formulas in 1-2-3 or Symphony, and dumping them as hex bytes, the formula
  767.  compilation logic can be deciphered.
  768.  
  769.  Table 1 describes the available Opcodes and functions.  The functions are
  770.  discussed in greater detail in the 1-2-3 and Symphony documentation.
  771.  
  772.  Appendix B discusses Lotus' proprietary formula compiler in greater
  773.  detail.
  774.  
  775.  Byte Number           Byte Description
  776.  0                     format (see Appendix A, Cell Format Encoding
  777.  1-2                   column
  778.  3-4                   row
  779.  5-12                  formula numeric value (IEEE long real; see NUMBER)
  780.  13-14                 formula size (bytes)
  781.  15+                   for code (see Table 1, Formula Opcodes); Reverse
  782.                        Polish Internal Notation; 2048 bytes maximum
  783.  
  784.                                    FORMULA
  785.  
  786.  Table 1-a Formula Compiler Opcode Table, Format
  787.  
  788.  Dec        Hex           Operation          Description
  789.  0          0             constant           Code is followed by an 8 byte
  790.                                              IEEE Long Real Floating Point
  791.                                              Number
  792.  
  793.  1          1             variable           Code followed by 4 byte coor-
  794.                                              dinate Byte 0,1 = Column
  795.                                              Byte 2,3 = Row
  796.  
  797.  2          2             range              Code followed by 8 byte range
  798.                                                Byte 0,1 = Start column
  799.                                                Byte 2,3 = Start row
  800.                                                Byte 4,5 = End column
  801.                                                Byte 6,7 = End row
  802.  
  803.  3          3             return               End of formula
  804.  
  805.  4          4             parentheses          Indicates presence of paren-
  806.                                                theses in original formula.
  807.                                                It is ignored during recal-
  808.                                                culation.
  809.  
  810.  5          5             2 byte integer       Followed by 2 byte signed
  811.                           constant             integer.
  812.  
  813.  The above Opcodes will define the type and length of information that
  814.  follows the Opcode.  Opcode 3 defines the end of the formula.
  815.  
  816.  For example, Opcode 0 is followed by an 8 byte floating point number.
  817.               Opcode 1 is followed by a 4 byte coordinate.
  818.               Opcode 2 is followed by an 8 byte range specifier.
  819.               Opcode 5 is followed by a 2 byte signed integer.
  820.  
  821.                                    FORMULA
  822.  
  823.  Table 1-b  Formula Compiler Opcode Table, Operations
  824.  
  825.  Dec       Hex         Operation         Description
  826.  
  827.  8         8           unary -           Negation
  828.  9         9           +                 Addition
  829.  10        A           -                 Subtraction
  830.  11        B           *                 Multiplication
  831.  12        C           /                 Division
  832.  13        D           ^                 Exponentiation;
  833.                                            ie. 3^2 is(3x3)
  834.  14        E           =                 Equal to
  835.  15        F           < >               Not equal to
  836.  16        10          < =               Less than or equal to
  837.  17        11          > =               Greater than or equal to
  838.  18        12          <                 Less than
  839.  19        13          >                 Greater than
  840.  20        14          #AND#             Logical AND
  841.  21        15          #OR#              Logical OR
  842.  22        16          #NOT#             Logical NOT
  843.  23        17          unary +           (Ignored during recalculation
  844.  31        1F          na                @Na not applicable
  845.  32        20          err               @Err error
  846.  33        21          abs               @abs (x) Absolute value of x
  847.  34        22          int               @int (x) Integer value of x
  848.  35        23          sqrt              @sqrt (x) Square root of x
  849.  36        24          log               @log (x) Log base 10 of x
  850.  37        25          ln                @ln (x) Log base e of x
  851.  38        26          pi                @pi
  852.  39        27          sin               @sin (x) Sine of x
  853.  40        28          cos               @cos (x) Cosine of x
  854.  41        29          tan               @tan (x) Tangent of x
  855.  42        2A          atan2             @atan2 (x) 4 quadrant arc tangent
  856.                                            of x
  857.  43        2B          atan              @atan (x) 2 quadrant arc tangent
  858.                                            of x
  859.  44        2C          asin              @asin (x) Arc sine of x
  860.  45        2D          acos              @acos (x) Arc cosine of x
  861.  46        2E          exp               @exp (x) Exponential anti-log of x
  862.  47        2F          mod               @mod (x,y)X Mod Y
  863.  48        30          sel               @Choose (x,v0,v1...vN)
  864.                                          Match a list item.
  865.  49        31          isna              @isna (x)x = NA then 1 (true)
  866.  
  867.                                    FORMULA
  868.  
  869.  Table 1-b (continued)  Formula Compiler Opcode Table, Operations
  870.  
  871.  Dec      Hex         Operation         Description
  872.  51       33          false             @false Return 0
  873.  52       34          true              @true Return 1
  874.  53       35          rand              @rand Generate random number
  875.                                         between 0 and 1
  876.  54       36          date              @date (Y,M,D) Generate the days
  877.                                         since 1/1/1900 (Y = 0-199,
  878.                                         M = 1-12, D = 1-31)
  879.  55       37          today             @today  Output serial date number
  880.                                         from cpu's clock
  881.  56       38          pmt               @pmt (princ, int, term)Payment
  882.  57       39          pv                @pv (pmt, int, term) Present value
  883.  58       3A          fv                @fv (pmt, int, term) Future Value
  884.  59       3B          if                @if (argument, them else) Boolean
  885.                                           if
  886.  60       3C          day               @day (x) Print day of the month from
  887.                                           a serial date number
  888.  61       3D          month             @month (x) Print month of the year
  889.                                           from a serial date number
  890.  62       3E          round             @round (x,d) Round number x to d
  891.                                           decimal places
  892.  
  893.  The above Opcodes are variable, constant and argument related.
  894.  
  895.  For example: @sqrt (9) is the square root of the constant 9
  896.               @sqrt (A1) is the square root of the variable A1
  897.               @sqrt ((A1*2)/3) is the square root of the argument (A1*2)/3
  898.                 (Note that the argument ((A1*2)/3) will be processed before
  899.                 the @sqrt function.)
  900.  
  901.                                    FORMULA
  902.  
  903.  Table 1-c  Formula Compiler Opcode Table, Multiple Arguments
  904.  
  905.  Dec      Hex      Operation        Description
  906.  80       50       sum              @sum (range and/or cell and/or
  907.                                       constant) Use commas to separate
  908.                                       arguments
  909.  81       51       avg              @avg (range and/or cell and/or constant)
  910.                                       Use commas to separate arguments
  911.  82       52       cnt              @cnt (range and/or cell and/or constant)
  912.                                       Use commas to separate arguments
  913.  83       53       min              @min (range and/or cell and/or constant)
  914.                                       Use commas to separate arguments
  915.  84       54       max              @max (range and/or cell and/or constant
  916.                                       Use commas to separate arguments
  917.  85       55       vlookup          @Vlookup (x, range, offset) X = Cell
  918.                                       address or constant, range = Table,
  919.                                       Offset = Row in Table
  920.  86       56       npv              @npv (int, range) Net present value;
  921.                                       Int = interest, Range = cash flows
  922.  87       57       var              @var (range) Variance of all items in
  923.                                       list
  924.  88       58       std              @std (range) Standard deviation of all
  925.                                       items in list
  926.  89       59       irr              @irr (guess,range) Guess = % estimate;
  927.                                       Range = range of cash flows
  928.  90       5A       hlookup          @hlookup, (x, range, offset) X = Cell
  929.                                       address or constant, range = Table,
  930.                                       Offseet = row in Table
  931.  91       5B       dsum             Database statistical functions
  932.  92       5C       avg              Database statistical functions
  933.  93       5D       dcnt             Database statistical functions
  934.  94       5E       dmin             Database statistical functions
  935.  95       5F       dmax             Database statistical functions
  936.  96       60       dvar             Database statistical functions
  937.  97       61       dstd             Database statistical functions
  938.  
  939.  The above Opcodes deal specifically with ranges and multiple arguments.
  940.  For example: @sum (A1...A10, B25, 9) contains a range, a variable and a
  941.  constant as the arguments.
  942.  
  943.            All function Opcodes which accept a variable number of arguments
  944.            are followed by a 1-byte argument count.
  945.  
  946.                                    FORMULA
  947.  
  948.  Table 1-d  Operator Precedence Table
  949.  
  950.  Operator       Unary Precedence       Binary Precedence
  951.    +                 6                        4
  952.    -                 6                        4
  953.    *                 na                       5
  954.    /                 na                       5
  955.    ^                 na                       7
  956.    =                 na                       3
  957.   < >                na                       3
  958.   < =                na                       3
  959.   > =                na                       3
  960.    <                 na                       3
  961.    >                 na                       3
  962.  #and#               na                       1
  963.   #or#               na                       1
  964.  #not#               2                        na
  965.  
  966.  A Note on the Decompiler
  967.  
  968.  The algorithm for the formula decompiler was taken verbatim from:
  969.  
  970.  Writing Interactive Compilers and Interpreters, P.J. Brown, John Wiley
  971.  and Sons, 1979.  See chapter 6.2.  The algorithm itself is described on
  972.  pages 216 and 217.
  973.  
  974.  This algorithm is also described in the following article:
  975.  
  976.  More on the Re-creation of Source Code from Reserve Polish, P.J. Brown,
  977.  Software Practice and Experience, Vol 7, 545-551 (1977).
  978.  
  979.                                     TABLE
  980.  
  981.  Record Type        Code         Body length
  982.  TABLE              24 (18h)     25 bytes
  983.  
  984.  Record Description
  985.  
  986.  Table range
  987.  
  988.  Used by both 1-2-3 and Symphony.
  989.  In 1-2-3, the record refers to Data Tables 1 and 2.
  990.  In Symphony, it refers to What-if Tables 1 and 2.
  991.  
  992.  Byte Number            Byte Description
  993.  
  994.  0                        0 = no table
  995.                           1 = Table 1
  996.                           2 = Table 2
  997.  
  998.  1-2                    Table Range;          starting column
  999.  3-4                                          starting row
  1000.  5-6                                          ending column
  1001.  7-8                                          ending row
  1002.  
  1003.  9-10                  Input Cell 1;          starting column
  1004.  11-12                                        starting row
  1005.  13-14                                        ending column
  1006.  15-16                                        ending row
  1007.  
  1008.  17-18                 Input Cell 2;          starting column
  1009.  19-20                                        starting row
  1010.  21-22                                        ending column
  1011.  23-24                                        ending row
  1012.  
  1013.                                     QRANGE
  1014.  
  1015.  Record Type        Code         Body length
  1016.  QRANGE             25 (19h)     25 bytes
  1017.  
  1018.  Record Description
  1019.  
  1020.  Query range
  1021.  Used in 1-2-3 only.
  1022.  
  1023.  Byte Number       Byte Description
  1024.  
  1025.  0-1               Input ranges;            starting column
  1026.  2-3                                        starting row
  1027.  4-5                                        ending column
  1028.  6-7                                        ending row
  1029.  8-9               Output ranges            starting column
  1030.  10-11                                      starting row
  1031.  12-13                                      ending column
  1032.  14-15                                      ending row
  1033.  16-17             Criteria;                starting column
  1034.  18-19                                      starting row
  1035.  20-21                                      ending column
  1036.  22-23                                      ending row
  1037.  24                Command;                    0 = no command
  1038.                                                1 = find
  1039.                                                2 = extract
  1040.                                                3 = delete
  1041.                                                4 = unique
  1042.  
  1043.                                     PRANGE
  1044.  
  1045.  Record Type        Code        Body length
  1046.  PRANGE             26 (1Ah)    8 bytes
  1047.  
  1048.  Record Description
  1049.  
  1050.  Print range
  1051.  
  1052.  Used in 1-2-3 only.
  1053.  
  1054.  Byte Number        Byte Description
  1055.  0-1                starting column
  1056.  2-3                starting row
  1057.  4-5                ending column
  1058.  6-7                ending row
  1059.  
  1060.  
  1061.  
  1062.  
  1063.                                     SRANGE
  1064.  
  1065.  Record Type         Code           Body length
  1066.  SRANGE              27 (1Bh)       8 bytes
  1067.  
  1068.  Record Description
  1069.  
  1070.  Sort range
  1071.  
  1072.  Used in 1-2-3 only.
  1073.  
  1074.  Byte Number         Byte Description
  1075.  
  1076.  0-1                 starting column
  1077.  2-3                 starting row
  1078.  4-5                 ending column
  1079.  6-7                 ending row
  1080.  
  1081.  
  1082.  
  1083.                                     FRANGE
  1084.  
  1085.  Record Type         Code          Body length
  1086.  FRANGE              28 (1Ch)      8 bytes
  1087.  
  1088.  Record Description
  1089.  
  1090.  Fill range
  1091.  
  1092.  Used by both 1-2-3 and Symphony.
  1093.  
  1094.  Byte Number          Byte Description
  1095.  
  1096.  0-1                  starting column
  1097.  2-3                  starting row
  1098.  4-5                  ending column
  1099.  6-7                  ending row
  1100.  
  1101.                                     KRANGE
  1102.  
  1103.  
  1104.  Record Type          Code           Body length
  1105.  KRANGE               29 (1Dh)       9 bytes
  1106.  
  1107.  Record Description
  1108.  
  1109.  Primary sort key range
  1110.  
  1111.  Used in 1-2-3 only.
  1112.  
  1113.  Byte Number          Byte Description
  1114.  
  1115.  0-1                  starting column
  1116.  2-3                  starting row
  1117.  4-5                  ending column
  1118.  6-7                  ending row
  1119.  8                    Order:  0 = descending order
  1120.                               FF = ascending order
  1121.  
  1122.  
  1123.  
  1124.                                     HRANGE
  1125.  
  1126.  
  1127.  Record Type         Code         Body length
  1128.  HRANGE              32 (20h)     16 bytes
  1129.  
  1130.  Record Description
  1131.  
  1132.  Distribution range
  1133.  
  1134.  Used by both 1-2-3 and Symphony.
  1135.  
  1136.  Byte Number         Byte Description
  1137.  
  1138.  0-1                 Values range;            starting column
  1139.  2-3                                          starting row
  1140.  4-5                                          ending column
  1141.  6-7                                          ending row
  1142.  8-9                 Bin range                   starting column
  1143.  10-11                                           starting row
  1144.  12-13                                           ending column
  1145.  14-15                                           ending row
  1146.  
  1147.                                   KRANGE2
  1148.  
  1149.  
  1150.  Record Type           Code           Body length
  1151.  
  1152.  KRANGE2               35(23h)        9 bytes
  1153.  
  1154.  Record Description
  1155.  
  1156.  Secondary sort key range
  1157.  
  1158.  Use in 1-2-3 only.
  1159.  
  1160.  Byte Number              Byte Description
  1161.  
  1162.  0-1                      starting column
  1163.  2-3                      starting row
  1164.  4-5                      ending column
  1165.  6-7                      ending row
  1166.  8                        Order;  0 =  descending order
  1167.                                   FF = ascending order
  1168.  
  1169.  
  1170.                                     PROTEC
  1171.  
  1172.  
  1173.  
  1174.  Record Type            Code              Body length
  1175.  
  1176.  PROTEC                 36(24h)           1 byte
  1177.  
  1178.  Record Description
  1179.  
  1180.  Global protection
  1181.  
  1182.  Used by both 1-2-3 and Symphony.
  1183.  
  1184.  Byte Number            Byte Description
  1185.  0                      0 = global protection OFF
  1186.                         1 = global protection ON
  1187.  
  1188.  
  1189.                                     FOOTER
  1190.  
  1191.  
  1192.  Record Type        Code        Body length
  1193.  
  1194.  FOOTER             37(25h)     242 bytes
  1195.  
  1196.  Record Description
  1197.  
  1198.  Print footer
  1199.  
  1200.  Used in 1-2-3 only.
  1201.  
  1202.  Byte Number       Byte Description
  1203.  0-241             NULL terminated ASCII string
  1204.  
  1205.                                     HEADER
  1206.  
  1207.  Record Type           Code            Body length
  1208.  
  1209.  HEADER                38(26h)         242 bytes
  1210.  
  1211.  Record Description
  1212.  
  1213.  Print header
  1214.  
  1215.  Used in 1-2-3 only.
  1216.  
  1217.  Byte Number         Byte Description
  1218.  0-241               NULL terminated ASCII string
  1219.  
  1220.  
  1221.                                     SETUP
  1222.  
  1223.  
  1224.  Record Type           Code           Body length
  1225.  
  1226.  SETUP                 39(27h)        40 bytes
  1227.  
  1228.  Record Description
  1229.  
  1230.  Print setup
  1231.  
  1232.  Used in 1-2-3 only.
  1233.  
  1234.  Byte Number          Byte Description
  1235.  
  1236.  0-39                 NULL terminated ASCII string
  1237.  
  1238.  
  1239.  
  1240.                                    MARGINS
  1241.  
  1242.  
  1243.  
  1244.  Record Type             Code            Body length
  1245.  
  1246.  MARGINS                 40(28h)         10 bytes
  1247.  
  1248.  Record Description
  1249.  
  1250.  Print margins code
  1251.  
  1252.  Used in 1-2-3 only.
  1253.  
  1254.  Byte Number             Byte Description
  1255.  
  1256.  0-1                     left margin
  1257.  2-3                     right margin
  1258.  4-5                     page length
  1259.  6-7                     top margin
  1260.  8-9                     bottom margin
  1261.  
  1262.                                    LABELFMT
  1263.  
  1264.  
  1265.  
  1266.  Record Type           Code            Body length
  1267.  
  1268.  LABELFMT              41 (29h)        1 byte
  1269.  
  1270.  Record Description
  1271.  
  1272.  Label alignment
  1273.  
  1274.  Used by both 1-2-3 and Symphony
  1275.  
  1276.  Byte Number          Byte Description
  1277.  
  1278.  0                    27h = left
  1279.                       22h = right
  1280.                       5Eh = center
  1281.  
  1282.  
  1283.  
  1284.  
  1285.                                     TITLES
  1286.  
  1287.  
  1288.  Record Types         Code            Body length
  1289.  
  1290.  TITLES               42(2Ah)         16 bytes
  1291.  
  1292.  Record Description
  1293.  
  1294.  Print borders
  1295.  
  1296.  Used in 1-2-3 only.
  1297.  
  1298.  Byte Number         Byte Description
  1299.  
  1300.  0-1                 Row border;                  starting column
  1301.  2-3                                              starting row
  1302.  4-5                                              ending column
  1303.  6-7                                              ending row
  1304.  8-9                 Column border;                  starting column
  1305.  10-11                                               starting row
  1306.  12-13                                               ending column
  1307.  14-15                                               ending row
  1308.  
  1309.  
  1310.                                     GRAPH
  1311.  
  1312.  
  1313.  Record Type          Code          Body length
  1314.  
  1315.  GRAPH                45(2Dh)       437 bytes
  1316.  
  1317.  Record Description
  1318.  
  1319.  Current graph settings
  1320.  
  1321.  Used in 1-2-3 only.
  1322.  
  1323.  Byte Number             Byte Description
  1324.  
  1325.                          -- see Table 2  Graph Record Structure --
  1326.  
  1327.  
  1328.  
  1329.  
  1330.                                     GRAPH
  1331.  
  1332.  
  1333.  Table 2   Graph Record Structure
  1334.  
  1335.  Byte Number          Byte Description
  1336.  
  1337.  0-1                  X Range;                starting column
  1338.  2-3                                          starting row
  1339.  4-5                                          ending column
  1340.  6-7                                          ending row
  1341.  
  1342.  8-9                  A Range;                starting column
  1343.  10-11                                        starting row
  1344.  12-13                                        ending column
  1345.  14-15                                        ending row
  1346.  
  1347.  16-17                B Range;                starting column
  1348.  18-19                                        starting row
  1349.  20-21                                        ending column
  1350.  22-23                                        ending row
  1351.  
  1352.  24-25                C Range;                starting column
  1353.  26-27                                        starting row
  1354.  28-29                                        ending column
  1355.  30-31                                        ending row
  1356.  
  1357.  32-33                D Range;                starting column
  1358.  34-35                                        starting row
  1359.  36-37                                        ending column
  1360.  38-39                                        ending row
  1361.  
  1362.  40-41                E Range;                starting column
  1363.  42-43                                        starting row
  1364.  44-45                                        ending column
  1365.  46-47                                        ending row
  1366.  
  1367.  48-49                F Range;                starting column
  1368.  50-51                                        starting row
  1369.  52-53                                        ending column
  1370.  54-55                                        ending row
  1371.  
  1372.  56-57                A Labels;               starting column
  1373.  58-59                                        starting row
  1374.  60-61                                        ending column
  1375.  62-63                                        ending row
  1376.  
  1377.  64-65                B Labels;               starting column
  1378.  66-67                                        starting row
  1379.  68-69                                        ending column
  1380.  70-71                                        ending row
  1381.  
  1382.  72-73                C Labels;               starting column
  1383.  74-75                                        starting row
  1384.  76-77                                        ending column
  1385.  78-79                                        ending row
  1386.  
  1387.                                     GRAPH
  1388.  
  1389.  
  1390.  Table 2   (continued)   Graph Record Structure
  1391.  
  1392.  Byte Number         Byte Description
  1393.  
  1394.  80-81                D Labels;               starting column
  1395.  82-83                                        starting row
  1396.  84-85                                        ending column
  1397.  86-87                                        ending row
  1398.  
  1399.  88-89               E Labels;                starting column
  1400.  90-91                                        starting row
  1401.  92-93                                        ending column
  1402.  94-95                                        ending row
  1403.  
  1404.  96-97               F Labels;                starting column
  1405.  98-97                                        starting row
  1406.  100-101                                      ending column
  1407.  102-103                                      ending row
  1408.  
  1409.  104                 Graph type               0 = XY, 1 = bar, 2 = pie,
  1410.                                                 4 = line, 5 = stacked bar
  1411.  
  1412.  105                 Grid;                    0 = none, 1 = horizontal,
  1413.                                                 2 = vertical, 3 = both
  1414.  
  1415.  106                 Color                    0 = black-white, FF = color
  1416.  
  1417.  107                 A Range line format;     0 = none, 1 = line,
  1418.                                                 2 = symbol, 3 = line-symbol
  1419.  
  1420.  108                 B Range line format;     0 = none, 1 = line,
  1421.                                                 2 = symbol, e = line-symbol
  1422.  
  1423.  109                 C Range line format;     0 = none, 1 = line,
  1424.                                                 2 = symbol, 3 = line-symbol
  1425.  
  1426.  110                 D Range line format;     0 = none, 1 = line,
  1427.                                                 2 = symbol, 3 = line-symbol
  1428.  
  1429.  111                 E Range line format;     0 = none, 1 = line,
  1430.                                                 2 = symbol, 3 = line-symbol
  1431.  
  1432.  112                 F Range line format;     0 = none, 1 = line,
  1433.                                                 2 = symbol, 3 = line-symbol
  1434.  
  1435.  113                 A Range data label       0 = center, 1 = right,
  1436.                       alignment;                2 = below, 3 = left,
  1437.                                                 4 = above
  1438.  
  1439.  114                 B Range data label       0 = center, 1 = right
  1440.                       alignment;                2 = below, 3 = left
  1441.                                                 4 = above
  1442.  
  1443.                                     GRAPH
  1444.  
  1445.  
  1446.  Table 2  (continued)  Graph Record Structure
  1447.  
  1448.  Byte Number         Byte Description
  1449.  
  1450.  115                 C Range data label       0 = center, 1 = right
  1451.                       alignment;                2 = below, 3 = left
  1452.                                                 4 = above
  1453.  
  1454.  116                 D Range data label       0 = center, 1 = right
  1455.                       alignment;                2 = below, 3 = left
  1456.                                                 4 = above
  1457.  
  1458.  117                 E Range data label       0 = center, 1 = right
  1459.                       alignment;                2 = below, 3 = left
  1460.                                                 4 = above
  1461.  
  1462.  118                 F Range data label       0 = center, 1 = right
  1463.                       alignment;                2 = below, 3 = left
  1464.                                                 4 = above
  1465.  119                 Scale                                    0 = auto
  1466.                                                               FF = manual
  1467.  
  1468.  120-127             X lower limit in floating point format
  1469.  
  1470.  128-135             X upper limit in floating point format
  1471.  
  1472.  136                 Y scale;                                 0 = automatic
  1473.                                                               FF = manual
  1474.  
  1475.  137-144             Y lower limit in floating point format
  1476.  
  1477.  145-152             Y upper limit in floating point format
  1478.  
  1479.  153-192             First title
  1480.  
  1481.  193-232             Second title
  1482.  
  1483.  233-272             X title
  1484.  
  1485.  273-312             Y title
  1486.  
  1487.  313-332             A legend
  1488.  
  1489.  333-352             B legend
  1490.  
  1491.  353-372             C legend
  1492.  
  1493.  373-392             D legend
  1494.  
  1495.                                     GRAPH
  1496.  
  1497.  
  1498.  Table 2  (continued)  Graph Record Structure
  1499.  
  1500.  Byte Number         Byte Description
  1501.  
  1502.  393-412             E legend
  1503.  
  1504.  413-432             F legend
  1505.  
  1506.  433                 X format
  1507.  
  1508.  434                 Y format
  1509.  
  1510.  435-436             Skip factor
  1511.  
  1512.                                     NGRAPH
  1513.  
  1514.  
  1515.  Record Type        Code         Body length
  1516.  
  1517.  NGRAPH             46 (2EH)     453 bytes
  1518.  
  1519.  Record Description
  1520.  
  1521.  Named current graph settings
  1522.  
  1523.  Used in 1-2-3 only.
  1524.  
  1525.  Bytes Number       Byte Description
  1526.  
  1527.                     -- see Table 3  Ngraph Record Structure --
  1528.  
  1529.                                     NGRAPH
  1530.  
  1531.  
  1532.  Table 3  NGraph Record Structure
  1533.  
  1534.  Byte Number      Byte Description
  1535.  
  1536.  0-15             Name;                  NULL terminated ASCII string
  1537.  
  1538.  16-17            X Range;               starting column
  1539.  18-19                                   starting row
  1540.  20-21                                   ending column
  1541.  22-23                                   ending row
  1542.  
  1543.  24-25            A Range;               starting column
  1544.  26-27                                   starting row
  1545.  28-29                                   ending column
  1546.  30-31                                   ending row
  1547.  
  1548.  32-33            B Range;               starting column
  1549.  34-35                                   starting row
  1550.  36-37                                   ending column
  1551.  38-39                                   ending row
  1552.  
  1553.  40-41            C Range;               starting column
  1554.  42-43                                   starting row
  1555.  44-45                                   ending column
  1556.  46-47                                   ending row
  1557.  
  1558.  48-49            D Range;               starting column
  1559.  50-51                                   starting row
  1560.  52-53                                   ending column
  1561.  54-55                                   ending row
  1562.  
  1563.  56-57            E Range;               starting column
  1564.  58-59                                   starting row
  1565.  60-61                                   ending column
  1566.  62-63                                   ending row
  1567.  
  1568.  64-65            F Range;               stating column
  1569.  66-67                                   starting row
  1570.  68-69                                   ending column
  1571.  70-71                                   ending row
  1572.  
  1573.  72-73            A Labels;              starting column
  1574.  74-75                                   starting row
  1575.  76-77                                   ending column
  1576.  78-79                                   ending row
  1577.  
  1578.  80-81            B Labels;              starting column
  1579.  82-83                                   starting row
  1580.  84-85                                   ending column
  1581.  86-87                                   ending row
  1582.  
  1583.                                     NGRAPH
  1584.  
  1585.  
  1586.  Table 3  (continued)  NGraph Record Structure
  1587.  
  1588.  Byte Number       Byte Description
  1589.  
  1590.  88-89             C Labels;                  starting column
  1591.  90-91                                        starting row
  1592.  92-93                                        ending column
  1593.  94-95                                        ending row
  1594.  
  1595.  96-97             D Labels;                  starting column
  1596.  98-99                                        starting row
  1597.  100-101                                      ending column
  1598.  102-103                                      ending row
  1599.  
  1600.  104-105           E Labels;                  starting column
  1601.  106-107                                      starting row
  1602.  108-109                                      ending column
  1603.  110-111                                      ending row
  1604.  
  1605.  112-113           F Labels;                  starting column
  1606.  114-115                                      starting row
  1607.  116-117                                      ending column
  1608.  118-119                                      ending row
  1609.  
  1610.  120               Graph type;                0 = XY, 1 = bar, 6 = pie,
  1611.                                                 4 = line, 5 = stacked bar
  1612.  
  1613.  121               Grid                       0 = none, 1 = horizontal,
  1614.                                                 2 = vertical, 3 = both
  1615.  
  1616.  122               Color;                     0 = black-white, FF = color
  1617.  
  1618.  123               A Range line format;       0 = none, l = line,
  1619.                                                 2 = symbol, 3 = line-symbol
  1620.  
  1621.  124               B Range line format;       0 = none, 1 = line,
  1622.                                                 2 = symbol, 3 = line-symbol
  1623.  
  1624.  125               C Range line format;       0 = none, 1 = line
  1625.                                                 2 = symbol, 3 = line-symbol
  1626.  
  1627.  126               D Range line format;       0 = none, 1 = line
  1628.                                                 2 = symbol, 3 = line-symbol
  1629.  
  1630.  127               E Range line format;       0 = none, 1 = line
  1631.                                                 2 = symbol, 3 = line-symbol
  1632.  
  1633.  128               F Range line format;       0 = none, 1 = line
  1634.                                                 2 = symbol, 3 = line-symbol
  1635.  
  1636.                                     NGRAPH
  1637.  
  1638.  
  1639.  Table 3  (continued)  NGraph Record Structure
  1640.  
  1641.  Byte Number         Byte Description
  1642.  
  1643.  129               A Range data label         0 = center, 1 = right
  1644.                      alignment                  2 = below, 3 = left,
  1645.                                                 4 = above
  1646.  
  1647.  130               B Range data label         0 = center, 1 = right
  1648.                      alignment                  2 = below, 3 = left
  1649.                                                 4 = above
  1650.  
  1651.  131               C Range data label         0 = center, 1 = right
  1652.                      alignment                  2 = below, 3 = left
  1653.                                                 4 = above
  1654.  
  1655.  132               D Range data label         0 = center, 1 = right
  1656.                      alignment                  2 = below, 3 = left
  1657.                                                 4 = above
  1658.  
  1659.  133               E Range data label         0 = center, 1 = right
  1660.                      alignment                  2 = below, 3 = left
  1661.                                                 4 = above
  1662.  
  1663.  134               F Range data label         0 = center, 1 = right
  1664.                      alignment                  2 = below, 3 = left
  1665.  
  1666.  135               X Scale                    0 = auto
  1667.                                               FF = manual
  1668.  
  1669.  136-143             X lower limit in floating point format
  1670.  
  1671.  144-151             X upper limit in floating point format
  1672.  
  1673.  152                 Y scale;                           0 = automatic
  1674.                                                         FF = manual
  1675.  
  1676.  153-160             Y lower limit in floating point format
  1677.  
  1678.  161-168             Y upper limit in floating point format
  1679.  
  1680.  
  1681.  169-208             First title
  1682.  
  1683.  209-248             Second title
  1684.  
  1685.  249-288             X title
  1686.  
  1687.  289-328             Y title
  1688.  
  1689.                                     NGRAPH
  1690.  
  1691.  
  1692.  Table 3  (continued)  NGraph Record Structure
  1693.  
  1694.  Byte Number         Byte Description
  1695.  
  1696.  329-348             A legend
  1697.  
  1698.  349-368             B legend
  1699.  
  1700.  369-388             C legend
  1701.  
  1702.  389-408             D legend
  1703.  
  1704.  409-428             E legend
  1705.  
  1706.  429-448             F legend
  1707.  
  1708.  449                 X format
  1709.  
  1710.  450                 Y format
  1711.  
  1712.  451-452             Skip factor
  1713.  
  1714.                                   CALCCOUNT
  1715.  
  1716.  
  1717.  Record Type       Code        Body length
  1718.  
  1719.  CALCCOUNT         47(2Fh)     1 byte
  1720.  
  1721.  Record Description
  1722.  
  1723.  Iteration count
  1724.  
  1725.  Used in 1-2-3 and Symphony.
  1726.  
  1727.  Byte Number       Byte Description
  1728.  
  1729.  0                 Iteration count
  1730.  
  1731.  
  1732.  
  1733.  
  1734.                                  UNFORMATTED
  1735.  
  1736.  Record Type         Code         Body length
  1737.  
  1738.  UNFORMATTED         48(30h)      1 byte
  1739.  
  1740.  Record Description
  1741.  
  1742.  Formatted/unformatted print
  1743.  
  1744.  Used in 1-2-3 only.
  1745.  
  1746.  Byte Number         Byte Description
  1747.  
  1748.  0                   0 = formatted
  1749.                      1 = unformatted
  1750.  
  1751.  
  1752.  
  1753.  
  1754.                                   CURSORW12
  1755.  
  1756.  
  1757.  Record Type         Code         Body length
  1758.  
  1759.  CURSORW12           49(31h)      1
  1760.  
  1761.  Record Description
  1762.  
  1763.  Cursor location
  1764.  
  1765.  Used in 1-2-3 only.
  1766.  
  1767.  Byte Number         Byte Description
  1768.  
  1769.  0                   1 = cursor in Window 1
  1770.                      2 = cursor in Window 2
  1771.  
  1772.                                     WINDOW
  1773.  
  1774.  
  1775.  Record Type              Code             Body length
  1776.  
  1777.  WINDOW                   50(32h)          144 bytes
  1778.  
  1779.  Record Description
  1780.  
  1781.  Window record structure
  1782.  
  1783.  Used in Symphony only.
  1784.  
  1785.  Byte Number              Byte Description
  1786.  
  1787.                           -- see Table 4  Window Record Structure --
  1788.  
  1789.                                     WINDOW
  1790.  
  1791.  
  1792.  Table 4  Window Record Structure
  1793.  
  1794.  Byte Number          Byte Description
  1795.  
  1796.  0-15                 Window name                    NULL terminated ASCII
  1797.                                                      string
  1798.  16-17                Cursor position;               column
  1799.  18-19                                               row
  1800.  20                   Format (see Appendix A,
  1801.                       Cell Format Encoding)
  1802.  
  1803.  21                   Unused
  1804.  22-23                Column width
  1805.  24-25                Total number of columns
  1806.  26-27                Total number of rows
  1807.  28-29                Non-Title Home Position;       column
  1808.  30-31                                               row
  1809.  32-33                Number of title columns
  1810.  34-35                Number of title rows
  1811.  36-37                Left title column
  1812.  38-39                Top title row
  1813.  40-41                Home position column
  1814.  42-43                Home position row
  1815.  44-45                Number of screen columns
  1816.  46-47                Number of screen rows
  1817.  
  1818.  48                   Hidden Status;                 0 = hidden
  1819.                                                      FF = not hidden
  1820.  
  1821.  49                   Previous window;               0 = SHEET
  1822.                                                      1 = DOC
  1823.                                                      2 = GRAPH
  1824.                                                      3 = COMM
  1825.                                                      4 = FORM
  1826.                                                      5 = APPLICATION
  1827.  
  1828.  50                  Border display;                 0 = cell
  1829.                                                      FF = no cell
  1830.  
  1831.  51                  Border display lines;           0 = lines
  1832.                                                      FF = no lines
  1833.  
  1834.  52-53               Window Range                    starting column
  1835.  54-55                                               starting row
  1836.  56-57                                               ending column
  1837.  58-59                                               ending row
  1838.  
  1839.  60-61               Offset
  1840.  
  1841.  62                  Insert mode flag;               0 = OFF
  1842.                                                      non-zero = ON
  1843.  
  1844.  63-78               Graph name
  1845.  
  1846.                                     WINDOW
  1847.  
  1848.  
  1849.  
  1850.  Table 4  (continued)  Window Record Structure
  1851.  
  1852.  Byte Number          Byte Description
  1853.  79                   Window type;                 0 = SHEET
  1854.                                                    1 = DOC
  1855.                                                    2 = GRAPH
  1856.                                                    3 = COMM
  1857.                                                    4 = FORM
  1858.                                                    5 = APPLICATION
  1859.  
  1860.  80                   Automatic display mode       "a" = automatic (ASCII
  1861.                       flag;                          lower case "a")
  1862.                                                      else = manual
  1863.  
  1864.  81                   Forms filter;                0 = filter
  1865.                                                    non-zero = no filter
  1866.  
  1867.  82-97                Associated form name
  1868.  98-99                Forms current record
  1869.  
  1870.  100                  Space display;               0 = no spaces
  1871.                                                    non-zero = spaces
  1872.  
  1873.  101                  Line spacing;                1 = 1 space
  1874.                                                    2 = 2 spaces
  1875.                                                    3 = 3 spaces
  1876.  
  1877.  102                  Justify type                 "1" = left (ASCII lower
  1878.                                                      case "1")
  1879.                                                    "r" = right (ASCII lower
  1880.                                                      case "r")
  1881.                                                    "c" = center (ASCII
  1882.                                                      lower case "c"
  1883.                                                    "e" = even (ASCII lower
  1884.                                                      case "e"
  1885.  
  1886.  103-104              Right Margin                 0 = FOh characters
  1887.                                                      = right margin
  1888.                                                    FF = no user-defined
  1889.                                                      right margin; use
  1890.                                                      default value
  1891.  
  1892.  105-106              Left Margin                  0-FOh characters = left
  1893.                                                      margin
  1894.  
  1895.  107-108              Tab interval
  1896.  109                  CR display;                  0 = soft
  1897.                                                    non-zero = hard
  1898.  110                  Auto-justify on copy/        0 = no
  1899.                         move;                      non-zero = yes
  1900.  111-126              Associated application
  1901.                         name
  1902.  127-143              Reserved Application Area
  1903.  
  1904.                                     STRING
  1905.  
  1906.  Record Type           Code           Body length
  1907.  
  1908.  STRING                51(33h)        variable
  1909.  
  1910.  Record Description
  1911.  
  1912.  Value of string formula
  1913.  
  1914.  Used in Symphony only.
  1915.  
  1916.  Byte Number          Byte Description
  1917.  
  1918.  0                    format (see Appendix A, Cell Format Encoding)
  1919.  1-2                  column
  1920.  3-4                  row
  1921.  5+                   NULL terminated ASCII string
  1922.  
  1923.  
  1924.  
  1925.                                    PASSWORD
  1926.  
  1927.  
  1928.  Record Type          Code           Body length
  1929.  PASSWORD             55(37h)        4 byte
  1930.  
  1931.  Record Description
  1932.  
  1933.  File lockout (CHKSUM)
  1934.  
  1935.  This is proprietary information.
  1936.  
  1937.  Used in Symphony only.
  1938.  
  1939.  Byte Number         Byte Description
  1940.  
  1941.                      -- not available --
  1942.  
  1943.  
  1944.  
  1945.                                     LOCKED
  1946.  
  1947.  Record Type           Code             Body length
  1948.  
  1949.  LOCKED                56(38h)          1 byte
  1950.  
  1951.  Record Description
  1952.  
  1953.  Lock Flag
  1954.  
  1955.  Used in Symphony only.
  1956.  
  1957.  Byte Number           Byte Description
  1958.  
  1959.  0                     0 = OFF
  1960.                        1 = ON
  1961.  
  1962.                                     QUERY
  1963.  
  1964.  
  1965.  Record Type          Code           Body length
  1966.  
  1967.  QUERY                60(3Ch)        127 bytes
  1968.  
  1969.  Record  Description
  1970.  
  1971.  Query settings
  1972.  
  1973.  Used in Symphony only.
  1974.  
  1975.  Byte Number          Byte Description
  1976.  
  1977.                       -- see Table 5  Query Record Structure --
  1978.  
  1979.                                     QUERY
  1980.  
  1981.  Table 5  Query Record Structure
  1982.  
  1983.  Byte Number            Byte Description
  1984.  
  1985.  0-15                   Name;                 NULL termination ASCII string
  1986.  
  1987.  16-17                  Input range;          starting column
  1988.  18-19                                        starting row
  1989.  20-21                                        ending column
  1990.  22-23                                        ending row
  1991.  
  1992.  24-25                  Output Range;         starting column
  1993.  26-27                                        starting row
  1994.  28-29                                        ending column
  1995.  30-31                                        ending row
  1996.  
  1997.  32-33                  Criteria Range;       starting column
  1998.  34-35                                        starting row
  1999.  36-37                                        ending column
  2000.  38-39                                        ending row
  2001.  
  2002.  40-41                  Form Entry;           starting column
  2003.  42-43                                        starting row
  2004.  44-45                                        ending column
  2005.  46-47                                        ending row
  2006.  
  2007.  48-49                  Form Def. Range;      starting column
  2008.  50-51                                        starting row
  2009.  52-53                                        ending column
  2010.  54-55                                        ending row
  2011.  
  2012.  56-57                  Report Output;        starting column
  2013.  58-59                                        starting row
  2014.  60-61                                        ending column
  2015.  62-63                                        ending row
  2016.  
  2017.  64-65                  Report Header;        starting column
  2018.  66-67                                        starting row
  2019.  68-69                                        ending column
  2020.  70-71                                        ending row
  2021.  
  2022.  72-73                  Report Footer;        starting column
  2023.  74-75                                        starting row
  2024.  76-77                                        ending column
  2025.  78-79                                        ending row
  2026.  
  2027.  80-81                  Table Range;          starting column
  2028.  82-83                                        starting row
  2029.  84-85                                        ending column
  2030.  86-87                                        ending row
  2031.  
  2032.  88-89                  Input Cell;           starting column
  2033.  90-91                                        starting row
  2034.  92-93                                        ending column
  2035.  94-95                                        ending row
  2036.  
  2037.                                     QUERY
  2038.  
  2039.  
  2040.  Table 5  (continued)  Query Record Structure
  2041.  
  2042.  Byte Number          Byte Description
  2043.  
  2044.  96-97                1st Key range;               starting column
  2045.  98-99                                             starting row
  2046.  100-101                                           ending column
  2047.  102-103                                           ending row
  2048.  
  2049.  104-105              2nd Key range;               starting column
  2050.  106-107                                           starting row
  2051.  108-109                                           ending column
  2052.  110-111                                           ending row
  2053.  
  2054.  112-113              3rd Key range;               starting column
  2055.  114-115                                           starting row
  2056.  116-117                                           ending column
  2057.  118-119                                           ending row
  2058.  
  2059.  120                  Last command;                0 = no command
  2060.                                                    1 = find
  2061.                                                    2 = extract
  2062.                                                    3 = delete
  2063.                                                    4 = unique
  2064.  
  2065.  121                  1st Key order;               0 = descending order
  2066.                                                    FF = ascending order
  2067.  
  2068.  122                  2nd Key order;               0 = descending order
  2069.                                                    FF = ascending order
  2070.  
  2071.  123                  3rd Key order                0 = descending order
  2072.                                                    FF = ascending order
  2073.  
  2074.  124                  Report number of passes;     0 = single pass
  2075.                                                    FF = multiple passes
  2076.  
  2077.  125                  Number of records;           0 = single
  2078.                                                    FF = multiple
  2079.  
  2080.  126                  Display underscores in       0 = no
  2081.                        entry form?                 FF = yes
  2082.  
  2083.                                   QUERYNAME
  2084.  
  2085.  
  2086.  Record Type          Code            Body length
  2087.  QUERYNAME            61(3Dh)         16 bytes
  2088.  
  2089.  Record Description
  2090.  
  2091.  Current Query Name
  2092.  
  2093.  Used in Symphony only.
  2094.  
  2095.  Byte Number         Byte Description
  2096.  
  2097.  0-15                NULL terminated ASCII string
  2098.  
  2099.  
  2100.  
  2101.  
  2102.                                     PRINT
  2103.  
  2104.  
  2105.  
  2106.  Record Type          Code            Body length
  2107.  PRINT                62(3Eh)         679 bytes
  2108.  
  2109.  Record Description
  2110.  
  2111.  Print record
  2112.  
  2113.  Used in Symphony only.
  2114.  
  2115.  Byte Number          Byte Description
  2116.  
  2117.                       -- see Table 6 Print Record Structure --
  2118.  
  2119.                                     PRINT
  2120.  
  2121.  
  2122.  Table 6  Print Record Structure
  2123.  
  2124.  Byte Number        Byte Description
  2125.  
  2126.  0-15               Print setting name;       NULL terminated ASCII string
  2127.  
  2128.  16-17              Source range;             starting column
  2129.  18-19                                        starting row
  2130.  20-21                                        ending column
  2131.  22-23                                        ending row
  2132.  
  2133.  24-25              Row border;               starting column
  2134.  26-27                                        starting row
  2135.  28-29                                        ending column
  2136.  30-31                                        ending row
  2137.  
  2138.  32-33              Column border;            starting column
  2139.  34-35                                        starting row
  2140.  36-37                                        ending column
  2141.  38-39                                        ending row
  2142.  
  2143.  40-41              Destination;              starting column
  2144.  42-43                                        starting row
  2145.  44-45                                        ending column
  2146.  46-47                                        ending row
  2147.  
  2148.  48                 Print format;             0 = as displayed
  2149.                                               non-zero = formulas
  2150.  
  2151.  49                 Page breaks               0 = yes
  2152.                                               non-zero = no
  2153.  50                 Line spacing
  2154.  51-52              Left Margin
  2155.  53-54              Right Margin
  2156.  55-56              Page length
  2157.  57-58              Top
  2158.  59-60              Bottom of page
  2159.  
  2160.  61-100             Setup string;             NULL terminated ASCII string
  2161.  101-342            Header;                   NULL terminated ASCII string
  2162.  343-584            Footer;                   NULL terminated ASCII string
  2163.  585-600            Source database name;     NULL terminated ASCII string
  2164.  
  2165.  601                Attribute;                0 = no
  2166.                                               non-zero = yes
  2167.  
  2168.  602                Space compression;        0 = no
  2169.                                               non-zero = yes
  2170.  
  2171.  603                Print destination         0 = printer
  2172.                                               1 = file
  2173.                                               2 = range
  2174.  
  2175.                                     PRINT
  2176.  
  2177.  
  2178.  Table 6  Print Record Structure
  2179.  
  2180.  Byte Number        Byte Description
  2181.  
  2182.  604-605            Starting page
  2183.  606-607            Ending page
  2184.  608-677            Destination filename;     NULL terminated ASCII string
  2185.  
  2186.  678                Wait;                     0 = no
  2187.                                               non-zero = yes
  2188.  
  2189.                                   PRINTNAME
  2190.  
  2191.  
  2192.  Record Type        Code           Body length
  2193.  
  2194.  PRINTNAME          63(3Fh)        16 bytes
  2195.  
  2196.  Record Description
  2197.  
  2198.  Current Print Record Name
  2199.  
  2200.  Used in Symphony only.
  2201.  
  2202.  Byte Number        Byte Description
  2203.  
  2204.  0-15               NULL terminated ASCII string
  2205.  
  2206.  
  2207.  
  2208.  
  2209.  
  2210.                                     GRAPH2
  2211.  
  2212.  
  2213.  
  2214.  Record Type        Code        Body length
  2215.  
  2216.  GRAPH2             64(40h)     499 bytes
  2217.  
  2218.  
  2219.  Record Description
  2220.  
  2221.  Graph record
  2222.  
  2223.  Used in Symphony only.
  2224.  
  2225.  Byte Number        Byte Description
  2226.  
  2227.                     -- see Table 7  Symphony Graph Record Structure --
  2228.  
  2229.                                     GRAPH2
  2230.  
  2231.  
  2232.  Table 7  Symphony Graph Record Structure
  2233.  
  2234.  Byte Number        Byte Description
  2235.  0-15               Name;                NULL terminated ASCII string
  2236.  
  2237.  16-17              XRange;              starting column
  2238.  18-19                                   starting row
  2239.  20-21                                   ending column
  2240.  22-23                                   ending row
  2241.  
  2242.  24-25              A Range;             starting column
  2243.  26-27                                   starting row
  2244.  28-29                                   ending column
  2245.  30-31                                   ending row
  2246.  
  2247.  32-33              B Range;             starting column
  2248.  34-35                                   starting row
  2249.  36-37                                   ending column
  2250.  38-39                                   ending row
  2251.  
  2252.  40-41              C Range;             starting column
  2253.  42-43                                   starting row
  2254.  44-45                                   ending column
  2255.  46-47                                   ending row
  2256.  
  2257.  48-49              D Range;             starting column
  2258.  50-51                                   starting row
  2259.  52-53                                   ending column
  2260.  54-55                                   ending row
  2261.  
  2262.  56-57              E Range;             starting column
  2263.  58-59                                   starting row
  2264.  60-61                                   ending column
  2265.  62-63                                   ending row
  2266.  
  2267.  64-65              F Range;             starting column
  2268.  66-67                                   starting row
  2269.  68-69                                   ending column
  2270.  70-71                                   ending row
  2271.  
  2272.  72-73              A Labels;            starting column
  2273.  74-75                                   starting row
  2274.  76-77                                   ending column
  2275.  78-79                                   ending row
  2276.  
  2277.  80-81              B Labels;            starting column
  2278.  82-83                                   starting row
  2279.  84-85                                   ending column
  2280.  86-87                                   ending row
  2281.  
  2282.  88-89              C Labels;            starting column
  2283.  90-91                                   starting row
  2284.  92-93                                   ending column
  2285.  94-95                                   ending row
  2286.  
  2287.                                     GRAPH2
  2288.  
  2289.  
  2290.  Table 7  (continued)  Symphony Graph Record Structure
  2291.  
  2292.  Byte Number         Byte Description
  2293.  
  2294.  96-97               D Labels;                     starting column
  2295.  98-99                                             starting row
  2296.  100-101                                           ending column
  2297.  102-103                                           ending row
  2298.  
  2299.  104-105             E Labels;                     starting column
  2300.  106-107                                           starting row
  2301.  108-109                                           ending column
  2302.  110-111                                           ending row
  2303.  
  2304.  112-113             F Labels;                     starting column
  2305.  114-115                                           starting row
  2306.  116-117                                           ending column
  2307.  118-119                                           ending row
  2308.  
  2309.  120                 Graph type;                   0 = XY, 1 = bar, 2 = pie,
  2310.                                                      4 = line, 5 = stacked
  2311.                                                      bar, 7=hi/low/open/close
  2312.  
  2313.  121                 Grid;                         0 = none, 1 = horizontal,
  2314.                                                      2 = vertical, 3 = both
  2315.  
  2316.  122                 Color;                        0 = black-white,
  2317.                                                      FF = color
  2318.  
  2319.  123                 A Range line format;          0 = none, 1 = line,
  2320.                                                      2 = symbol,
  2321.                                                      3 = line-symbol
  2322.  
  2323.  124                 B Range line format;          0 = none, 1 = line,
  2324.                                                      2 = symbol,
  2325.                                                      3 = line-symbol
  2326.  
  2327.  125                 C Range line format;          0 = none, 1 = line,
  2328.                                                      2 = symbol,
  2329.                                                      3 = line-symbol
  2330.  
  2331.  126                 D Range line format;          0 = none, 1 = line
  2332.                                                      2 = symbol,
  2333.                                                      3 = line-symbol
  2334.  
  2335.  127                 E Range line format;          0 = none, 1 = line
  2336.                                                      2 = symbol,
  2337.                                                      3 = line-symbol
  2338.  
  2339.  128                 F Range line format;          0 = none, 1 = line
  2340.                                                      2 = symbol
  2341.                                                      3 = line-symbol
  2342.  
  2343.                                     GRAPH2
  2344.  
  2345.  
  2346.  Table 7  (continued)  Symphony Graph Record Structure
  2347.  
  2348.  Byte Number    Byte Description
  2349.  
  2350.  129                 A Range data label alignment; 0 = center, 1 = right,
  2351.                                                      2 = below, 3 = left,
  2352.                                                      4 = above
  2353.  
  2354.  130                 B Range data label alignment; 0 = center, 1 = right
  2355.                                                      2 = below, 3 = left
  2356.                                                      4 = above
  2357.  
  2358.  131                 C Range data label alignment; 0 = center, 1 = right
  2359.                                                      2 = below, 3 = left
  2360.                                                      4 = above
  2361.  
  2362.  132                 D Range data label alignment; 0 = center, 1 = right
  2363.                                                      2 = below, 3 = left
  2364.                                                      4 = above
  2365.  
  2366.  133                 E Range data label alignment; 0 = center, 1 = right
  2367.                                                      2 = below, 3 = left
  2368.                                                      4 = above
  2369.  
  2370.  134                 F Range data label alignment; 0 = center, 1 = right
  2371.                                                      2 = below, 3 = left
  2372.                                                      4 = above
  2373.  
  2374.  135            X Scale                                 0 = auto, FF=manual
  2375.  
  2376.  136-143        X lower limit in floating point format
  2377.  
  2378.  144-151        X upper limit in floating point format
  2379.  
  2380.  152            Y scale;                                0 = automatic
  2381.                                                         FF = manual
  2382.  
  2383.  153-160        Y lower limit in floating point format
  2384.  
  2385.  161-168        Y upper limit in floating point format
  2386.  
  2387.  169-208        First title
  2388.  
  2389.  209-248        Second title
  2390.  
  2391.  249-288        X title
  2392.  
  2393.  289-328        Y title
  2394.  
  2395.                                     GRAPH2
  2396.  
  2397.  
  2398.  Table 7  (continued)  Symphony Graph Record Structure
  2399.  
  2400.  Byte Number    Byte Description
  2401.  
  2402.  329-348        A legend
  2403.  
  2404.  349-368        B legend
  2405.  
  2406.  369-388        C legend
  2407.  
  2408.  389-408        D legend
  2409.  
  2410.  409-428        E legend
  2411.  
  2412.  429-448        F legend
  2413.  
  2414.  449            X format
  2415.  
  2416.  450            Y format
  2417.  
  2418.  451-452        Skip factor
  2419.  
  2420.  453            X scale flag; (x1K)                     0 = ON
  2421.                                                         FF = OFF
  2422.  
  2423.  454            Y scale flag;(x1K)                      0 = ON
  2424.                                                         FF = OFF
  2425.  
  2426.  455            suppress;                               0 = no
  2427.                                                         else = yes
  2428.  
  2429.  456-463        Bar origin (float)
  2430.  464-471        X linear scale (float)
  2431.  472-479        Y linear scale (float)
  2432.  480            X log scale
  2433.  481            Y log scale
  2434.  
  2435.  482            graph region color;                     X hue code
  2436.  483                                                    A hue code
  2437.  484                                                    B hue code
  2438.  485                                                    C hue code
  2439.  486                                                    D hue code
  2440.  487                                                    E hue code
  2441.  488                                                    F hue code
  2442.  489-490        Y width
  2443.  491-498        Aspect (float)
  2444.  
  2445.                                   GRAPHNAME
  2446.  
  2447.  
  2448.  Record Type          Code          Body length
  2449.  
  2450.  GRAPHNAME            65 (41h)      16 bytes
  2451.  
  2452.  Record Description
  2453.  
  2454.  Current Graph Record Name
  2455.  
  2456.  Used in Symphony only.
  2457.  
  2458.  Byte Number          Byte Description
  2459.  
  2460.  0-15                 NULL terminated ASCII string
  2461.  
  2462.  
  2463.  
  2464.  
  2465.                                      ZOOM
  2466.  
  2467.  
  2468.  
  2469.  Record Type      Code          Body length
  2470.  
  2471.  ZOOM             66 (42h)      9 bytes
  2472.  
  2473.  Record Description
  2474.  
  2475.  Original coordinates expanded window
  2476.  
  2477.  Used in Symphony only.
  2478.  
  2479.  Byte Number      Byte Description
  2480.  
  2481.  0                iszoom?                0 = no
  2482.                                          1 = yes
  2483.  1-2              X coordinates
  2484.  3-4              Y coordinates
  2485.  5-6              column depth
  2486.  7-8              row depth
  2487.  
  2488.                                    SYMSPLIT
  2489.  
  2490.  
  2491.  Record Type         Code         Body length
  2492.  
  2493.  SYMSPLIT            67 (43h)     2 bytes
  2494.  
  2495.  Record Description
  2496.  
  2497.  Number of split windows
  2498.  
  2499.  Used in Symphony only.
  2500.  
  2501.  Byte Number        Byte Description
  2502.  
  2503.  0-1                number of split windows
  2504.  
  2505.  
  2506.  
  2507.                                     NSROWS
  2508.  
  2509.  Record Type Code Body length
  2510.  
  2511.  NSROWS        Code         Body length
  2512.  
  2513.  NSROWS        68 (44h)     2 bytes
  2514.  
  2515.  Record Description
  2516.  
  2517.  Number of screen rows
  2518.  
  2519.  Used in Symphony only.
  2520.  
  2521.  Byte Number    Byte Description
  2522.  
  2523.  0-1            number of screen rows
  2524.  
  2525.  
  2526.  
  2527.                                     NSCOLS
  2528.  
  2529.  
  2530.  Record Type          Code           Body length
  2531.  
  2532.  NSCOLS               69 (45h)       2 bytes
  2533.  
  2534.  Record Description
  2535.  
  2536.  Number of screen columns
  2537.  
  2538.  Used in Symphony only.
  2539.  
  2540.  Byte Number         Byte Description
  2541.  
  2542.  0-1                 Number of screen columns
  2543.  
  2544.                                     RULER
  2545.  
  2546.  
  2547.  
  2548.  Record Type        Code        Body length
  2549.  
  2550.  RULER              70 (46h)    25 bytes
  2551.  
  2552.  Record Description
  2553.  
  2554.  Name ruler range
  2555.  
  2556.  Used in Symphony only.
  2557.  
  2558.  Byte Number        Byte Description
  2559.  
  2560.  0-15               Name;                NULL terminated ASCII string
  2561.  16-17              Range;                 starting column
  2562.  18-19                                     starting row
  2563.  20-21                                     ending column
  2564.  22-23                                     ending row
  2565.  24                 Range type;            0 = single cell
  2566.                                            1 = range
  2567.  
  2568.  
  2569.  
  2570.                                     NNAME
  2571.  
  2572.  
  2573.  Record Type           Code          Body length
  2574.  
  2575.  NNAME                 71 (47h)      25 bytes
  2576.  
  2577.  Record Description
  2578.  
  2579.  Named sheet range
  2580.  
  2581.  Used in Symphony only.
  2582.  
  2583.  Byte Number        Byte Description
  2584.  
  2585.  0-15               Name;                NULL terminated ASCII string
  2586.  16-17              Range;                  starting column
  2587.  18-19                                      starting row
  2588.  20-21                                      ending column
  2589.  22-23                                      ending row
  2590.  24                 Range type;          0 = single cell
  2591.                                          1 = range
  2592.  
  2593.                                     ACCOM
  2594.  
  2595.  
  2596.  Record Type          Code         Body length
  2597.  
  2598.  ACOMM                72 (48h)     65 bytes
  2599.  
  2600.  Record Description
  2601.  
  2602.  Autoload communications file
  2603.  
  2604.  Used in Symphony only.
  2605.  
  2606.  Byte Number         Byte Description
  2607.  
  2608.  0-64                Path name to Autoload file;
  2609.                      NULL terminated ASCII string
  2610.  
  2611.  
  2612.  
  2613.  
  2614.                                     AMACRO
  2615.  
  2616.  
  2617.  Record Type        Code          Body length
  2618.  
  2619.  AMACRO             73 (49h)      8 bytes
  2620.  
  2621.  Record Description
  2622.  
  2623.  Autoexecute macro address
  2624.  
  2625.  Used in Symphony only.
  2626.  
  2627.  Byte Number        Byte Description
  2628.  
  2629.  0-1                starting column
  2630.  2-3                starting row
  2631.  4-5                ending column
  2632.  6-7                ending row
  2633.  
  2634.                                     PARSE
  2635.  
  2636.  
  2637.  Record Type        Code         Body length
  2638.  
  2639.  PARSE              74 (4Ah)     16 bytes
  2640.  
  2641.  Record Description
  2642.  
  2643.  Query parse information
  2644.  
  2645.  
  2646.  Used in Symphony only.
  2647.  
  2648.  Byte Number       Byte Description
  2649.  
  2650.  0-1               Parse range;          starting column
  2651.  2-3                                     starting row
  2652.  4-5                                     ending column
  2653.  6-7                                     ending row
  2654.  8-9               Review range;            starting column
  2655.  10-11                                      starting row
  2656.  
  2657.                             WORKSHEET FILE FORMAT
  2658.                                   FROM LOTUS
  2659.  
  2660.                       APPENDIX A - CELL FORMAT ENCODING
  2661.  
  2662.                Copyright(c) 1984, Lotus Development Corporation
  2663.                                161 First Street
  2664.                         Cambridge, Massachusetts 02142
  2665.                                 (617) 492-7171
  2666.                       Electronic Edition, December, 1984
  2667.                              All Rights Reserved
  2668.  
  2669.                       APPENDIX A:  Cell Format Encoding
  2670.  
  2671.  
  2672.  The first byte of a content-related record contains a cell format code.
  2673.  
  2674.  Format is determined at the bit level.
  2675.  
  2676.  
  2677.  Table 8   Cell Format Encoding
  2678.  
  2679.  Bit number     Description               Code             Meaning
  2680.  7              protection                1                protected
  2681.                                           0                unprotected
  2682.  
  2683.  4,5,6          format type               0                fixed
  2684.                                           1                scientific
  2685.                                                              notation
  2686.                                           2                currency
  2687.                                           3                percent
  2688.                                           4                comma
  2689.                                           5                unused
  2690.                                           6                unused
  2691.                                           7                special
  2692.  0,1,2,3        number of decimal         0-15
  2693.                  places decoded
  2694.                  (if format type = 0-6)
  2695.  
  2696.                 special format type       0                +/-
  2697.                 (if format type = 7)      1                general
  2698.                                           2                day-month-year
  2699.                                           3                day-month
  2700.                                           4                month-year
  2701.                                           5                text
  2702.                 (Symphony only)           6                hidden
  2703.                 (Symphony only)           7                date;hour-min-sec
  2704.                 (Symphony only)           8                date;hour-min
  2705.                 (Symphony only)           9                date;intnt'l1
  2706.                 (Symphony only)           10               date;intnt'l1
  2707.                 (Symphony only)           11               time;intnt'l1
  2708.                 (Symphony only)           12               time;intnt'l2
  2709.                                           13-14            unused
  2710.                                           15               default
  2711.  
  2712.  
  2713.  EXAMPLE
  2714.  
  2715.  Currency format, two decimal places, unprotected cell
  2716.  
  2717.  
  2718.  Bit Number    7   6   5   4   3   2   1   0
  2719.  Binary Code   0   0   1   0   0   0   1   0
  2720.                    ---------
  2721.                   Format Type ---------------
  2722.                Protection     Number of Decimal Places
  2723.                                   or Special Format
  2724.  
  2725.  The byte number is 0.
  2726.  The hex code is 22.
  2727.  
  2728.  
  2729.  Example
  2730.  
  2731.  Special format, month-year, protected cell
  2732.  
  2733.  
  2734.  Bit Number     7   6   5   4   3   2   1   0
  2735.  Binary Code    1   1   1   1   0   1   0   0
  2736.                     ---------
  2737.                    Format Type  -------------
  2738.                  Protection    Number of Decimal Places
  2739.                                   or Special Format
  2740.  
  2741.  
  2742.  The byte number is 0.
  2743.  The hex code is F4.
  2744.  
  2745.                             WORKSHEET FILE FORMAT
  2746.                                   FROM LOTUS
  2747.  
  2748.                       APPENDIX B - THE FORMULA COMPILER
  2749.  
  2750.                Copyright(c) 1984, Lotus Development Corporation
  2751.                                161 First Street
  2752.                         Cambridge, Massachusetts 02142
  2753.                                 (617) 492-7171
  2754.                       Electronic Edition, December, 1984
  2755.                              All Rights Reserved
  2756.  
  2757.                       APPENDIX B:  The Formula Compiler
  2758.  
  2759.  This appendix describes the internal workings of the formula compiler.  The
  2760.  compiler transforms an ASCII string of characters representing a formula to
  2761.  its Reverse Polish code.  The basic algorithm utilizes and SR parser (SR =
  2762.  shift and reduce).  The aim of the parser is to apply a set of reduction
  2763.  rules which embody the syntax of the compiler to an input string.  Formula
  2764.  code is compiled to a temporary buffer.
  2765.  
  2766.  Lexicon Analysis
  2767.  
  2768.  A lexical analyzer breaks up the input string into lexical units called
  2769.  tokens.  A token is a substring of the original input string operand,
  2770.  operator, or special symbol (such as comma, parentheses, etc.) In addition,
  2771.  the lexical analyser supplies two special tokens, "beginning of formula"
  2772.  (boform) and "end of formula" (eoform), to facilitate the compilation
  2773.  process.  The lexical analyzer identifies and processes literals (both
  2774.  number and string), cell and range references, operators, and function
  2775.  calls.  It assigns a unique code to each distinct operator, function, or
  2776.  type of operand.
  2777.  
  2778.  A function with no arguments is treated like a number.
  2779.  
  2780.  Syntax Analysis
  2781.  
  2782.  The syntactical analysis of a formula is accomplished by processing a list
  2783.  of tokens in left-to-right order.  A stack called the syntax is also used
  2784.  during the syntactical scan.  The basic algorithm is as follows:
  2785.  
  2786.  Repeat the following steps:
  2787.  
  2788.  1) Get the next token
  2789.  
  2790.  2) If the token is a literal or cell reference:
  2791.        a) Push the number code on the syntax stack
  2792.        b) Push the number code on the syntax stack
  2793.  
  2794.  3) If the token is a range reference:
  2795.        a) Compile code to push the range reference
  2796.        b) Push the range code on the syntax stack
  2797.  
  2798.  4) Otherwise push the token code for the token on the syntax stack.
  2799.  
  2800.  For each syntax rule, if the pattern on the top of the  syntax matches the
  2801.  rule pattern take the action associated with the rule and start scanning
  2802.  from the beginning for any additional rules which may apply.
  2803.  
  2804.  When a token code is pushed on the syntax stack, an additional word of
  2805.  zeros is also pushed on the stack.  This is used when compiling function
  2806.  calls to hold the function's argument count.
  2807.  
  2808.  Rule Matching
  2809.  
  2810.  A relatively small number of rules are used to process formulas of arbitrary
  2811.  complexity.  If a rule matches the top of the syntax stack, then the
  2812.  compiler takes a specific action and rule scanning starts again with the
  2813.  first rule.  Each rule matches certain patterns on the syntax stack.  A
  2814.  typical rule might be: if the top of the stack is the token for right
  2815.  parenthesis, and the next-to-top is a number, and the second form the top
  2816.  is a left parenthesis, then pop the top three items from the syntax stack
  2817.  and push the number on the syntax stack.
  2818.  
  2819.  This rule can be more succinctly represented as:
  2820.  
  2821.                         Stack
  2822.  
  2823.           Before                      After                 Action
  2824.           )
  2825.           number
  2826.           (                           number                none
  2827.  
  2828.  
  2829.  
  2830.  The Rules
  2831.  
  2832.  
  2833.  The following are the syntax rules used to process formulas.  Note that the
  2834.  order of the rules is important.  The rules for compilation of operators
  2835.  used additional tables which assign a precedence number and opcode to each
  2836.  legal unary and binary operator.  Thus, for example, there is a single
  2837.  token code for minus sign (-), but there are two opcodes one for unary
  2838.  minus and one for binary minus.  In addition, these two operators, while
  2839.  lexically identical, also have different precedence.  In general, operators
  2840.  of higher precedence will be performed before operators of lower precedence
  2841.  are performed left-to-right.  All special operators (boform, eoform,
  2842.  parentheses, comma, etc.) are implicitly assigned a precedence of zero.
  2843.  
  2844.  Rule 1  Termination test
  2845.  
  2846.                   Stack
  2847.  
  2848.          Before           After       Action
  2849.          eoform                       Output a return code to compile buffer
  2850.          number                       Return, indicating successful compile
  2851.          boform
  2852.  
  2853.  Rule 2  Function argument processing
  2854.  
  2855.                  Stack
  2856.          Before          After       Action
  2857.          '                           Error if range argument illegal for
  2858.          number or range             function.
  2859.          (               (           Increment argument count on stack
  2860.          function        function
  2861.  
  2862.  Rule 3  Process final function argument
  2863.  
  2864.                  Stack
  2865.          Before         After        Action
  2866.          )                           Error if range argument illegal for
  2867.          number or range             function.
  2868.          (                           Increment argument count on stack
  2869.          function       number       Compile function opcode
  2870.                                      If list function, compile argument
  2871.                                      count; otherwise error is wrong
  2872.                                      argument count
  2873.  Rule 4  Parenthesis removal
  2874.  
  2875.                 Stack
  2876.         Before         After        Action
  2877.         )                           Compile parenthesis opcode
  2878.         number
  2879.         (              number
  2880.         operator       operator
  2881.  
  2882.  
  2883.  
  2884.  Rule 5  Binary operators
  2885.  
  2886.                Stack
  2887.         Before         After        Action
  2888.         op2                         If binary op<binary op, rule does
  2889.         number                      not match.  Otherwise, compile opcode
  2890.         op1            op2          for operator op1.
  2891.  
  2892.  
  2893.  Rule 6  Unary operators
  2894.  
  2895.                Stack
  2896.         Before      After           Action
  2897.         op2                         I unary op<binary op, rule does
  2898.         number      op2             not match.  Otherwise, compile opcode.
  2899.         op1         number          for operator op 1.
  2900.  
  2901.  
  2902.  Rule 7  Error detection
  2903.  
  2904.               Stack
  2905.        Before       After          Action
  2906.        eoform                      Return indicating unsuccessful compile
  2907.  
  2908.  Table 9   Operator Precedence Table
  2909.  
  2910.  Operator              Unary Precedence       Binary Precedence
  2911.  +                             6                      4
  2912.  -                             6                      4
  2913.  *                            na                      5
  2914.  /                            na                      7
  2915.  ^                            na                      3
  2916.  =                            na                      3
  2917.  < >                          na                      3
  2918.  < =                          na                      3
  2919.  > =                          na                      3
  2920.  <                            na                      3
  2921.  >                            na                      3
  2922.  #and#                        na                      1
  2923.  #or#                         na                      1
  2924.  #not#                        2                      na
  2925.  
  2926.  Example:
  2927.  
  2928.  Using the above rules, we can now see how a particular formula is
  2929.  compiled.  Let us consider the following formula:
  2930.  
  2931.                   3+5*6
  2932.  
  2933.  This is broken up by the lexical analyzer into seven tokens.
  2934.  
  2935.                   boform
  2936.                   3
  2937.                   +
  2938.                   5
  2939.                   *
  2940.                   6
  2941.                   eoform
  2942.  
  2943.  The syntax scans proceed as follows until a matching rule is found:
  2944.  
  2945.  Stack
  2946.  
  2947.  boform           number         +            number
  2948.                   boform         number       +
  2949.                                  boform       number
  2950.                                               boform
  2951.  
  2952.  Compile buffer
  2953.  
  2954.                   push 3         push 3       push 3
  2955.                                               push 5
  2956.  
  2957.  At this point, rule 5 is invoked, but since the precedence of boform is
  2958.  zero, no action is taken.
  2959.  
  2960.  Stack
  2961.  
  2962.  *                number
  2963.  number           *
  2964.  +                number
  2965.  number           +
  2966.  boform           number
  2967.                   boform
  2968.  
  2969.  Compile buffer
  2970.  
  2971.  push 3           push 3
  2972.  push 5           push 5
  2973.                   push 6
  2974.  
  2975.  At this  point, since the binary precedence of + is lower than the binary
  2976.  precedence of *, rule 5 does apply, and the opcode for * is compiled.  The
  2977.  stack is reduced by replacing number * number by number and scan is made,
  2978.  but no further rule applies.
  2979.  
  2980.  
  2981.  Stack
  2982.  
  2983.  number          eoform
  2984.  +               number
  2985.  number          +
  2986.  boform          number
  2987.                  boform
  2988.  
  2989.  Compile buffer
  2990.  
  2991.  push 3          push 3
  2992.  push 5          push 5
  2993.  push 6          push 6
  2994.  
  2995.  
  2996.  
  2997.  Rule 5 applies again, and the opcode for + is compiled, reducing the stack
  2998.  to boform, number, eoform.  Rescanning finds a match on rule 1 which
  2999.  compiles a return opcode and terminates.  The final compiled code is thus:
  3000.  
  3001.  push 3
  3002.  push 5
  3003.  push 6
  3004.  *
  3005.  +
  3006.  return
  3007.  
  3008.  A Note on the Decompiler
  3009.  
  3010.  The algorithm for the formula decompiler was taken verbatim from:
  3011.  
  3012.  Writing Interactive Compilers and Interpreters, P.J. Brown, John Wiley and
  3013.  Sons, 1979.  See chapter 6.2.  The algorithm itself is described on pages
  3014.  216 and 217.
  3015.  
  3016.  This algorithm is also described in the following article.
  3017.  
  3018.  More on the Re-creation of Source Code from Reverse Polish, P.J. Brown,
  3019.  Software Practice and Experience, Vol 7, 545-551 (1977).
  3020.  
  3021.  WORKSHEET COLUMN DESIGNATORS
  3022.  
  3023.  Most records within the 1-2-3 Condensed Worksheet format are specified
  3024.  with column/row designators (for example, column 0, row 0 equals A1).  When
  3025.  determining the column designator, the table below will help make
  3026.  conversion easier.
  3027.  
  3028.  
  3029.  
  3030.  Column   Hex   Dec        Column   Hex   Dec        Column   Hex   Dec
  3031.    A       0     0           BA     34     52          DA     68    104
  3032.    B       1     1           BB     35     53          DB     69    105
  3033.    C       2     2           BC     36     54          DC     6A    106
  3034.    D       3     3           BD     37     55          DD     6B    107
  3035.    E       4     4           BE     38     56          DE     6C    108
  3036.    F       5     5           BF     39     57          DF     6D    109
  3037.    G       6     6           BG     3A     58          DG     6E    110
  3038.    H       7     7           BH     3B     59          DH     6F    111
  3039.    I       8     8           BI     3C     60          DI     70    112
  3040.    J       9     9           BJ     3D     61          DJ     71    113
  3041.    K       A    10           BK     3E     62          DK     72    114
  3042.    L       B    11           BL     3F     63          DL     73    115
  3043.    M       C    12           BM     40     64          DM     74    116
  3044.    N       D    13           BN     41     65          DN     75    117
  3045.    O       E    14           BO     42     66          DO     76    118
  3046.    P       F    15           BP     43     67          DP     77    119
  3047.    Q      10    16           BQ     44     68          DQ     78    120
  3048.    R      11    17           BR     45     69          DR     79    121
  3049.    S      12    18           BS     46     70          DS     7A    122
  3050.    T      13    19           BT     47     71          DT     7B    123
  3051.    U      14    20           BU     48     72          DU     7C    124
  3052.    V      15    21           BV     49     73          DV     7D    125
  3053.    W      16    22           BW     4A     74          DW     7E    126
  3054.    X      17    23           BX     4B     75          DX     7F    127
  3055.    Y      18    24           BY     4C     76          DY     80    128
  3056.    Z      19    25           BZ     4D     77          DZ     81    129
  3057.   AA      1A    26           CA     4E     78          EA     82    130
  3058.   AB      1B    27           CB     4F     79          EB     83    131
  3059.   AC      1C    28           CC     50     80          EC     84    132
  3060.   AD      1D    29           CD     51     81          ED     85    133
  3061.   AE      1E    30           CE     52     82          EE     86    134
  3062.   AF      1F    31           CF     53     83          EF     87    135
  3063.   AG      20    32           CG     54     84          EG     88    136
  3064.   AH      21    33           CH     55     85          EH     89    137
  3065.   AI      22    34           CI     56     86          EI     8A    138
  3066.   AJ      23    35           CJ     57     87          EJ     8B    139
  3067.   AK      24    36           CK     58     88          EK     8C    140
  3068.   AL      25    37           CL     59     89          EL     8D    141
  3069.   AM      26    38           CM     5A     90          EM     8E    142
  3070.   AN      27    39           CN     5B     91          EN     8F    143
  3071.   AO      28    40           CO     5C     92          EO     90    144
  3072.   AP      29    41           CP     5D     93          EP     91    145
  3073.   AQ      2A    42           CQ     5E     94          EQ     92    146
  3074.   AR      2B    43           CR     5F     95          ER     93    147
  3075.   AS      2C    44           CS     60     96          ES     94    148
  3076.   AT      2D    45           CT     61     97          ET     95    149
  3077.   AU      2E    46           CU     62     98          EU     96    150
  3078.   AV      2F    47           CV     63     99          EV     97    151
  3079.   AW      30    48           CW     64    100          EW     98    152
  3080.   AX      31    49           CX     65    101          EX     99    153
  3081.   AY      32    50           CY     66    102          EY     9A    154
  3082.   AZ      33    51           CZ     67    103          EZ     9B    155
  3083.  
  3084.  (CONTINUED)
  3085.                Column   Hex    Dec         Column    Hex    Dec
  3086.  
  3087.                  FA     9C     156           HA      DO     208
  3088.                  FB     9D     157           HB      D1     209
  3089.                  FC     9E     158           HC      D2     210
  3090.                  FD     9F     159           HD      D3     211
  3091.                  FE     AO     160           HE      D4     212
  3092.                  FF     A1     161           HF      D5     213
  3093.                  FG     A2     162           HG      D6     214
  3094.                  FH     A3     163           HH      D7     215
  3095.                  FI     A4     164           HI      D8     216
  3096.                  FJ     A5     165           HJ      D9     217
  3097.                  FK     A6     166           HK      DA     218
  3098.                  FL     A7     167           HL      DB     219
  3099.                  FM     A8     168           HM      DC     220
  3100.                  FN     A9     169           HN      DD     221
  3101.                  FO     AA     170           HO      DE     222
  3102.                  FP     AB     171           HP      DF     223
  3103.                  FQ     AC     172           HQ      EO     224
  3104.                  FR     AD     173           HR      E1     225
  3105.                  FS     AE     174           HS      E2     226
  3106.                  FT     AF     175           HT      E3     227
  3107.                  FU     BO     176           HU      E4     228
  3108.                  FV     B1     177           HV      E5     229
  3109.                  FW     B2     178           HW      E6     230
  3110.                  FX     B3     179           HX      E7     231
  3111.                  FY     B4     180           HY      E8     232
  3112.                  FZ     B5     181           HZ      E9     233
  3113.                  GA     B6     182           IA      EA     234
  3114.                  GB     B7     183           IB      EB     235
  3115.                  GC     B8     184           IC      EC     236
  3116.                  GD     B9     185           ID      ED     237
  3117.                  GE     BA     186           IE      EE     238
  3118.                  GF     BB     187           IF      EF     239
  3119.                  GG     BC     188           IG      FO     240
  3120.                  GH     BD     189           IH      F1     241
  3121.                  GI     BE     190           II      F2     242
  3122.                  GJ     BF     191           IJ      F3     243
  3123.                  GK     CO     192           IK      F4     244
  3124.                  GL     C1     193           IL      F5     245
  3125.                  GM     C2     195           IM      F6     246
  3126.                  GN     C3     195           IN      F7     247
  3127.                  GO     C4     196           IO      F8     248
  3128.                  GP     C5     197           IP      F9     249
  3129.                  GQ     C6     198           IQ      FA     250
  3130.                  GR     C7     199           IR      FB     251
  3131.                  GS     C8     200           IS      FC     252
  3132.                  GT     C9     201           IT      FD     253
  3133.                  GU     CA     202           IU      FE     254
  3134.                  GV     CB     203           IV      FF     255
  3135.                  GW     CC     204
  3136.                  GX     CD     205
  3137.                  GY     CE     206
  3138.                  GZ     CF     207
  3139.  
  3140.  ANALYSIS OF 1-2-3  WORKSHEET FILE
  3141.  
  3142.  The worksheet shown below was created in 1-2-3 and saved to disk.
  3143.  
  3144.  
  3145.  
  3146.                                               Key:
  3147.  
  3148.                                               A2..A5 Named Range (code 11)
  3149.           EXAMPLE                                 A2: Label (code 15)
  3150.              100                                  A3: Integer (code 13)
  3151.             12.5                                  A4: Number (code 14)
  3152.             87.5                                  A5: Formula (+A3-A4)
  3153.                                                       (code 16)
  3154.  
  3155.  
  3156.  The example shown below is a partial hex dump of this worksheet file.  By
  3157.  reading each record header, you can determine the type of record you are
  3158.  encountering.  The record header will also tell you the length of that
  3159.  follows the header.  By analyzing the record header, you can read the
  3160.  records you want and skip unrelated records.
  3161.  
  3162.  
  3163.     362B:0100                           06 00 08 00 00 00 00 00 00 00
  3164.     362B:0110        04 00 2F 00 01 00  01 02 00 01 00 FF 03 00 01 00
  3165.     362B:0120        00 04 00 01 00 00  05 00 01 00 FF 07 00 1F 00 00
  3166.     362B:0130        00 01 00 71 00 09  00 08 00 14 00 00 00 00 00 00
  3167.     362B:0140        00 00 00 00 00 00  00 04 00 04 00 48 00 00 0B 00
  3168.     362B:0150        18 00 54 45 53 54  00 00 00 00 00 00 00 00 00 00
  3169.     362B:0160        00 00 00 00 01 00  00 00 04 00 18 00 19 00 00 FF
  3170.     362B:0170        FF 00 00 FF FF 00  00 FF FF 00 00 FF FF 00 00 FF
  3171.     362B:0180
  3172.  
  3173.  
  3174.     362B:05C0
  3175.     362B:05D0        00 00 00 00 00 00  00 00 00 00 00 00 00 00 00 00
  3176.     362B:05E0        00 00 00 00 00 00  00 00 00 00 00 00 00 00 00 00
  3177.     362B:05F0        00 00 00 00 71 71  01 00 0F 00 0E 00 FF 00 00 01
  3178.     362B:0600        00 27 45 58 41 4D  50 4C 45 00 0D 00 07 00 FF 00
  3179.     362B:0610        00 02 00 64 00
  3180.     362B:0620                           10 00 1B 00 FF 00 00 04 00 00
  3181.     362B:0630        00 00 00 00 E0 55  40 0C 00 01 00 80 FE BF 01 00
  3182.     362B:0640        80 FF BF 0A 03
  3183.  
  3184.  
  3185. 
  3186.