home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 425.lha / spread_v1.01 / spread.doc < prev    next >
Encoding:
Text File  |  1990-10-01  |  14.0 KB  |  335 lines

  1.     SPREAD - Tiny Amiga spreadsheet
  2.  
  3.     Spread history (as if you care):
  4.  
  5.     This program grew from a notion I had, 4 years ago, that a
  6. spreadsheet would be a good tool to have, to help with certain jobs at
  7. the office. I had read about VisiCalc, and later Lotus 1-2-3, but I had
  8. never used a spreadsheet, so I designed Spread with few pre-conceived
  9. notions about how it should work. As far as I know, Spread bears little
  10. resemblance to any other spreadsheet.
  11.  
  12.     The first version of Spread was written to run on a PDP-11
  13. running RT11 or TSX, with a VT220 terminal. It was written in Decus C,
  14. it only supported fixed-12-character columns, and only what the screen
  15. could display. It was later enhanced to support a larger worksheet with
  16. scrolling, and to support a 132 column display. Spread is still used at
  17. the office almost use daily.
  18.  
  19.     When I found myself dialing in to work from my Amiga to use
  20. Spread fairly often (a long distance phone call too), I decided it was
  21. time to port the program over to the Amiga.
  22.  
  23.     The PDP-11 Spread used VT220 display controls and accepted VT220
  24. function keys. These are not completely compatible with the features of
  25. the Amiga CON: device, so I decided to re-write the user interface to
  26. make best use of the Intuition's input and output features.
  27.  
  28.     I started work on the Amiga version in early January 1988, and
  29. spent most evenings and weekends at the keyboard (my wife hated it). You
  30. have the result before you.
  31.  
  32.     Amiga Spread supports a few features the PDP11 version doesn't,
  33. specifically the ability of a text cell to overlay empty cells to the
  34. right, the ability to set the column width and decimals, it supports a
  35. larger worksheet (The PDP version must run in only 56K!), and of course
  36. the Intuition interface.
  37.  
  38.     Spread features:
  39.  
  40.     o Small 36 X 60 worksheet
  41.     o Four basic math functions, plus row and column summing
  42.     o Intuition-ized user interface
  43.     o Resizable Workbench window
  44.     o Absolute and symbolic cell references in formulas
  45.     o Worksheet editing: insert/delete row, insert/delete column
  46.     o Cell editing: cut, copy, paste, erase single cells
  47.     o Variable column width and decimal places
  48.     o Automatic or Manual recalculation
  49.  
  50.     Running Spread:
  51.  
  52.     Spread can be invoked from the CLI or launched from a Workbench
  53. icon. If launched from the Workbench, the Lattice C startup code will
  54. first open a standard input/output window, which Spread ignores. It is
  55. recommended that Spread be given a stack size of 8000. A larger stack
  56. size provides no benefit.
  57.  
  58.     If Spread is run from the CLI, you can include a command
  59. parameter specifying the name of a file which Spread will load as the
  60. current spreadsheet.
  61.  
  62.     The Spread window gives a display of (r) rows and (n) columns.
  63. The number of rows and columns depends on the current size of the
  64. display window, the width of the individual columns, and the narrow/wide
  65. font selection. The intersection of each line and column is called a
  66. cell. Cells may be empty, or they may contain text, or they may contain
  67. a formula.
  68.  
  69.     Spread currently supports 60 rows and 36 columns. This is very
  70. small by commercial product standards.
  71.  
  72.     In the window, one cell is displayed in reverse; this indicates
  73. the 'cursor'. The cursor may be moved using the arrow keys, or by
  74. pointing to a cell with the mouse pointer and clicking.
  75.  
  76.     If a movement would place the cursor on a cell which is not in
  77. the display window, the display is scrolled. The horizontal and vertical
  78. scroll bars also move the display window and the cursor.
  79.  
  80.     If a cell contains text, then the text is displayed in the
  81. window in that cell. If the text is wider than the current column's
  82. width, then the text will 'overflow' into empty cells to the right of
  83. the selected cell. If the text is so long that it would overflow into a
  84. cell that is occupied, then the text is truncated at that point.
  85.  
  86.     If a cell contains a formula, then the result of the formula is
  87. displayed in the cell in the window. Calculations are double precision
  88. floating point. The number display is initially 2 decimal places.
  89.  
  90.     The contents of a formula cell is a string in simple algebraic
  91. notation. It is evaluated according to the following rules:
  92. Multiplication ('*'), division ('/'), and modulo ('%') are performed
  93. first, from left to right; then addition ('+') and subtraction ('-')
  94. from left to right; then MAX and MIN left to right; then conditionals
  95. from left to right. The order of evauation can be forced by the use of
  96. parentheses.
  97.  
  98.     If you want a cell to simply contain a number, then make it a
  99. formula cell, and type in the number you want as the formula.
  100.  
  101.     Formula cells may be given logical names. The names can be
  102. referred to in other cells' formulas to call the value from the cell;
  103. this allows cell position changes within the display without affecting
  104. the logical sources for values in formulas. Only formula cells may be
  105. given names. The name must begin with a letter, and may contain
  106. letters and numbers. It may not contain spaces.
  107.  
  108.     Cell editing (text, formula, or name) is done in the string
  109. gadgets at the bottom of the window.
  110.  
  111.     When the cursor is on an empty cell, the entry gadgets at the
  112. bottom of the window are ghosted and cannot be selected. The "Cells"
  113. menu allows the choice of either a text cell or a formula cell. If
  114. "Cells/Edit Text cell" or "Cells/Edit Formula Cell" is chosen, then the
  115. cell type is chosen, the text gadget is enabled and activated, and the
  116. text may be entered immediately.
  117.  
  118.     When the cursor is on a text cell, the cell's text is placed in
  119. the text gadget. This gadget can be selected and the text modified.
  120.  
  121.     When the cursor is on a formula cell, the cell's formula and
  122. name are placed in the text and name gadgets. These can be selected and
  123. modified.
  124.  
  125.     If you wish to change a text cell to a forumla cell or vice
  126. versa, you must erase the current cell and define it anew. The menu
  127. entries "Edit/Cut" or "Edit/Erase" will erase the contents of a cell.
  128.  
  129.     Calculation can be set to automatic or manual. In automatic
  130. mode, whenever a formula cell is edited or any change which may effect
  131. the numeric results of other cells is performed, recalculation takes
  132. place. In manual mode, recalculation is done when the "Calculate/
  133. Evaluate" menu entry is selected, when the user presses the 'C' key, and
  134. upon loading a new spreadsheet from disk, and no other time.
  135.  
  136.     Calculation is done as follows: Each formula in the spreadsheet
  137. is solved, starting in cell R0C0 and moving down, then repeating for
  138. successive columns moving right. Cells which depend on other cells'
  139. values should be placed under or to the right of the cells which supply
  140. the values.
  141.  
  142.     If a cell must make a 'forward' reference, to a cell which will
  143. be calculated later in the spreadsheet, then calculating twice will
  144. usually result in the correct value.
  145.  
  146.     If a calculation can't be performed, the cell will display asterisks
  147. ('****.**') instead of a number. You should inspect your formula to see
  148. what is wrong. You may have left your parentheses unbalanced, or perhaps
  149. you refer to a cell name that you haven't defined. 
  150.  
  151.     Formulas
  152.  
  153.     Formulas are algebraic expressions similar to FORTRAN or BASIC
  154. expressions. Operations proceed left to right, according heirarchy
  155. (multiplication after addition, etc). Expressions may be grouped with
  156. parentheses.
  157.  
  158.     Values are included in an expression using the following
  159. notations:
  160.  
  161.     <value>    - a number, like '10', '-5', '2.34'
  162.     RmCn    - takes the value in the cell at row (m) column (n)
  163.           Special case, either (m) or (n) can be '.', which
  164.           means to use the current row/column
  165.     name    - takes the value in the cell with the given name.
  166.  
  167.     The following arithmetic operators are provided:
  168.  
  169.     +    Addition                p + q
  170.     -    Subtraction                p - q
  171.     *    Multiplication                p * q
  172.     /    Division                p / q
  173.     %    Modulo (remainder from division)    p % q
  174.     MAX    greater of two values            p MAX q
  175.     MIN    lesser of two values            p MIN q
  176.  
  177.     -    Negate                    -p
  178.     ABS    Absolute value                ABS(p), ABS p
  179.     INT    Extract integer portion            INT(p), INT p
  180.  
  181.     SUM    Sum of all cells in a row or column above/to the left of
  182.         the current cell. SUM's format:
  183.  
  184.         SUM(RmCn)
  185.  
  186.         'm' and 'n' can be:
  187.             a row/column number
  188.             '.' to specify the current row/column
  189.             '*' to specify all the rows/columns above/to
  190.                 the left
  191.         Any of the above formats for 'row' and 'col' can be
  192.         combined except R*C*, which is invalid.
  193.  
  194.     Conditional Binary operators; these are entered as binary
  195. operators (one operand on each side) and give the second operand if the
  196. conditional test on the first operand is true, otherwise they give zero:
  197.  
  198.     ?EQ    op = 0            7 ?EQ 3 = 0    0 ?EQ 3 = 3
  199.     ?NE    op not = 0        7 ?NE 3 = 3    0 ?NE 3 = 0    
  200.     ?GT    op greater than 0    7 ?GT 3 = 3    -7 ?GT 3 = 0
  201.     ?GE    op greater or equal 0    7 ?GE 3 = 3    -7 ?GE 3 = 0
  202.     ?LT    op less than 0        7 ?LT 3 = 0    -7 ?LT 3 = 3
  203.     ?LE    op less or equal 0    7 ?LE 3 = 0    -7 ?LE 3 = 3
  204.  
  205.  
  206.     Spread menu selections:
  207.  
  208.     "Project" Menu
  209.  
  210.     "Project/New": Erases the entire contents of the current
  211. spreadsheet.
  212.  
  213.     "Project/Load": Erases the entire contents of the current
  214. spreadsheet, then loads a previously-saved spreadsheet. This brings up a
  215. requester asking for the name of the file to load.
  216.  
  217.     "Project/Save": Saves the current spreadsheet into a file.
  218. Project/Save uses the same file name as the spreadsheet that was loaded,
  219. or if no file name has been specified, it puts up a requester asking for
  220. the name of the file to save to.
  221.  
  222.     "Project/Save as..": saves the current spreadsheet into a file.
  223. This puts up a requester asking for the name of the file to save to.
  224.  
  225.     "Project/Print": prints to a file a displayable image of the
  226. current spreadsheet. This puts up a requester asking for the name of the
  227. file to print to, which can be "PRT:" to print directly to the printer.
  228. (Note: background printing is not implemented, meaning that Spread will
  229. stall until the spreadsheet had been printed entirely.)
  230.  
  231.     "Project/About Spread": Try it and see.
  232.  
  233.     "Project/Quit": Leaves Spread. If a spreadsheet is loaded it
  234. will be lost; make sure you save it first if you want to keep it. The
  235. close window button in the upper left corner performs the same function.
  236.  
  237.     "Edit" Menu
  238.  
  239.     "Edit/Cut": The current cell is saved in the paste buffer, and
  240. becomes empty. (The 'current' cell is the cell the cursor is positioned
  241. on, which is displayed in reverse.)
  242.  
  243.     "Edit/Copy": The current cell is saved in the paste buffer. The
  244. current cell is not altered.
  245.  
  246.     "Edit/Paste": If the current cell is empty, then the contents of
  247. the paste buffer is placed in the current cell.
  248.  
  249.     "Edit/Erase": The current cell is made empty. It is not saved in
  250. the paste buffer, and the paste buffer is not disturbed.
  251.  
  252.     "Edit/Insert Row": The contents of all cells below and to the
  253. right of the current cell, including the current cell, are shifted one
  254. row down. The current cell and all the cells in the current row to the
  255. right are made empty.
  256.  
  257.     "Edit/Insert Col": The contents of all cells below and to the
  258. right of the current cell, including the current cell, are shifted one
  259. row to the left. The current cell and all cells below the current cell
  260. are made empty.
  261.  
  262.     "Edit/Delete Row": The contents of all cells below and to the
  263. right of the current cell are shifted one row up. The contents of the
  264. current cell, and of all cells in the current row to the right, are
  265. lost.
  266.  
  267.     "Edit/Delete Col": The contents of all cells below and to the
  268. right of the current cell are shifted one row to the left. The contents
  269. of the current cell, and of all cells in the current column below, are
  270. lost.
  271.  
  272.     Warning: If any cells use RmCn notation with actual cell numbers
  273. in a formula, and the target cell is moved by any insert or delete
  274. operation, then it's likely the formula is now incorrect. The cell name
  275. feature should be used when making references to cells in formulas, as
  276. name references are resolved regardless of cell locations.
  277.  
  278.     "Cells" Menu
  279.  
  280.     "Cells/Edit Cell Text": If the current cell is empty, it is made
  281. a text cell. The Text gadget at the bottom of the window is activated,
  282. as if you had clicked on it. Pressing the 'E' key has the same effect as
  283. "Cells/Edit Cell Text", or if the text gadget is not ghosted you may
  284. simply click on it to edit.
  285.  
  286.     "Cells/Edit Cell Formula": If the current cell is empty, it is
  287. made a formula cell. The Text gadget at the bottom of the window is
  288. activated, as if you had clicked on it. Pressing the 'F' key has the
  289. same effect as "Cells/Edit Cell Formula", or if the text gadget is not
  290. ghosted you may simply click on it to edit.
  291.  
  292.     "Cells/Edit Cell Name": The Name gadget at the bottom of the
  293. window is activated, as if you had clicked on it. Pressing the 'N' key
  294. has the same effect as "Cells/Edit Cell Name", or if the name gadget is
  295. not ghosted you may simply click on it to edit.
  296.  
  297.     "Calculate" Menu
  298.  
  299.     "Calculate/Evaluate": The formulas in the current spreadsheet
  300. are solved, and the results of the calculations are displayed in the
  301. formula cells. This is the way to cause calculation if Auto Calc is
  302. disabled, or if a calculation makes a forward referece to a cell (see
  303. 'order of calculation' above).
  304.  
  305.     "Calculate/Auto Calc": When this entry is checked, the 'auto
  306. calc' feature is enabled. Selecting this entry toggles it's state
  307. between enabled (checked) and disabled (not checked).
  308.  
  309.     "Format" Menu
  310.  
  311.     "Format/Set Column Width": This entry brings up a requester
  312. which allows you to enter the width of the current column, by the number
  313. of characters it should hold.
  314.  
  315.     "Format/Set Decimal Places": This entry brings up a requester
  316. which allows you to enter the number of digits to the right of the
  317. decimal point should be printed for formula cells in the current column.
  318.  
  319.     "Format/Set Normal Font": Selecting this entry causes Spread to
  320. use Topaz/8 for cell display.
  321.  
  322.     "Format/Set Narrow Font": Selecting this entry causes Spread to
  323. use the teeny/8 font for cell display. The teeny/8 font distributed with
  324. Spread uses 5 pixel wide character spacing, which can display up to 128
  325. characters on the 640-pixel Workbench screen, although the border
  326. imagery around the Spread window allows only about 120 characters. If
  327. the 'teeny/8' font is not in your current fonts: directory, this menu
  328. selection will be ghosted.
  329.  
  330.     If you generate your own font and call it teeny/8, or copy
  331. another existing font to teeny/8, then Spread will use it with it's
  332. metrics. It should be an 8 pixel high font, but could be a wider or
  333. narrower font, fixed spacing or proportional. Spread will adjust
  334. accordingly.
  335.