home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Product / Product.zip / sc621_3.zip / sc.man < prev    next >
Text File  |  1992-10-24  |  70KB  |  1,849 lines

  1.  
  2.  
  3.  
  4. SC 6.21 (1)              USER COMMANDS                SC 6.21 (1)
  5.  
  6.  
  7.  
  8. NAME
  9.      sc - spreadsheet calculator
  10.  
  11. SYNOPSIS
  12.      sc [ -c ] [ -m ] [ -n ] [ -r ] [ -x ] [ _f_i_l_e ]
  13.  
  14. DESCRIPTION
  15.      The spreadsheet calculator _s_c is based on rectangular tables
  16.      much like a financial spreadsheet.  When invoked it presents
  17.      you with a table organized as rows and columns of cells.  If
  18.      invoked  without  a  _f_i_l_e  argument,  the table is initially
  19.      empty.  Otherwise _f_i_l_e is  read  in  (see  the  _G_e_t  command
  20.      below).   Each  cell  may  have associated with it a numeric
  21.      value, a label string, and/or an expression (formula)  which
  22.      evaluates to a numeric value or label string, often based on
  23.      other cell values.
  24.  
  25.      For a on-line tutorial, type the command:
  26.  
  27.           sc tutorial.sc
  28.  
  29.      To print a quick reference card, type the command:
  30.  
  31.           scqref | [your_printer_commmand]
  32.  
  33. OPTIONS
  34.      -c   Start the program with the recalculation being done  in
  35.           column order.
  36.  
  37.      -m   Start the program  with  automatic  recalculation  dis-
  38.           abled.   The spreadsheet will be recalculated only when
  39.           the ``@'' command is used.
  40.  
  41.      -n   Start the program in  quick  numeric  entry  mode  (see
  42.           below).
  43.  
  44.      -r   Start the program with the recalculation being done  in
  45.           row order (default option).
  46.  
  47.      -x   Cause the _G_e_t and _P_u_t commands (see below)  to  encrypt
  48.           and decrypt data files.
  49.  
  50.      -R   Start the program with automatic newline action set  to
  51.           increment the row (see below).
  52.  
  53.      -C   Start the program with automatic newline action set  to
  54.           increment the column (see below).
  55.  
  56.      All of these options can be changed with the ^_T and  _S  com-
  57.      mands  (see  below)  while _s_c is running.  Options specified
  58.      when _s_c is invoked override options saved in the data file.
  59.  
  60.  
  61.  
  62.  
  63.                                                                 1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. SC 6.21 (1)              USER COMMANDS                SC 6.21 (1)
  71.  
  72.  
  73.  
  74.   General Information
  75.      The screen is divided into four regions.  The  top  line  is
  76.      for  entering  commands  and  displaying  cell  values.  The
  77.      second line is for messages from _s_c.  The third line and the
  78.      first  four  columns  show  the column and row numbers, from
  79.      which are derived cell addresses, e.g.  _A_0 for the  cell  in
  80.      column   A,  row  0.   Note  that  column  names  are  case-
  81.      insensitive: you can enter _A_0 or _a_0.
  82.  
  83.      The rest of the screen forms a window looking at  a  portion
  84.      of  the table.  The total number of display rows and columns
  85.      available, hence  the  number  of  table  rows  and  columns
  86.      displayed, is set by _c_u_r_s_e_s(3) and may be overridden by set-
  87.      ting the LINES and COLUMNS  environment  variables,  respec-
  88.      tively.
  89.  
  90.      The screen has two cursors: a cell cursor,  indicated  by  a
  91.      highlighted  cell and a ``<'' on the screen, and a character
  92.      cursor, indicated by the terminal's  hardware  cursor.   The
  93.      cell  and character cursors are often the same.  They differ
  94.      when you type a command on the top line.
  95.  
  96.      If a cell's numeric value is wider  than  the  column  width
  97.      (see  the _f command), the cell is filled with asterisks.  If
  98.      a cell's label string is wider than the column width, it  is
  99.      truncated  at  the  start  of the next non-blank cell in the
  100.      row, if any.
  101.  
  102.      Cursor control commands and row and column commands  can  be
  103.      prefixed  by  a  numeric  argument  which indicates how many
  104.      times the command is to be executed.  You can type ^_U before
  105.      a  repeat count if quick numeric entry mode is enabled or if
  106.      the number is to be entered while the character cursor is on
  107.      the top line.
  108.  
  109.      Commands which use the terminal's control key, such  as  ^_N,
  110.      work  both  when a command is being typed and when in normal
  111.      mode.
  112.  
  113.   Changing Options
  114.  
  115.      ^T_o  Toggle options.  This command allows you to switch  the
  116.           state  of one option selected by _o.  A small menu lists
  117.           the choices for  _o  when  you  type  ^_T.   The  options
  118.           selected are saved when the data and formulas are saved
  119.           so that you will have the  same  setup  next  time  you
  120.           enter the spreadsheet.
  121.  
  122.           a    Automatic Recalculation.  When set, each change in
  123.                the  spreadsheet  causes the entire spreadsheet be
  124.                recalculated.  Normally this  is  not  noticeable,
  125.                but  for very large spreadsheets, it may be faster
  126.  
  127.  
  128.  
  129.                                                                 2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. SC 6.21 (1)              USER COMMANDS                SC 6.21 (1)
  137.  
  138.  
  139.  
  140.                to clear automatic recalculation mode  and  update
  141.                the   spreadsheet  via  explicit  ``@''  commands.
  142.                Default is automatic recalculation on.
  143.  
  144.           c    Current  cell  highlighting.   If   enabled,   the
  145.                current  cell is highlighted (using the terminal's
  146.                standout mode, if available) in addition to  being
  147.                marked by the cell cursor.
  148.  
  149.           e    External  function  execution.    When   disabled,
  150.                external  functions  (see  @_e_x_t()  below)  are not
  151.                called.  This saves a lot of time at  each  screen
  152.                update.    External   functions  are  disabled  by
  153.                default.  If disabled, and external functions  are
  154.                used  anywhere, a warning is printed each time the
  155.                screen is updated, and the result of @_e_x_t() is the
  156.                value  from  the  previous call, if any, or a null
  157.                string.
  158.  
  159.           l    Autolabeling.  If enabled, using the  define  com-
  160.                mand  (/d) causes a label to be automatically gen-
  161.                erated in the cell to  the  left  of  the  defined
  162.                cell.   This  is only done if the cell to the left
  163.                is empty.  Default is enabled.
  164.  
  165.           n    Quick numeric entry.  If enabled, a typed digit is
  166.                assumed to be the start of a numeric value for the
  167.                current cell, not a repeat count, unless  preceded
  168.                by  ^_U.   The  cursor controls (^_P, ^_N, ^_B, ^_F) in
  169.                this mode will end a numeric entry.
  170.  
  171.           t    Top line display.  If enabled, the name and  value
  172.                of  the current cell is displayed on the top line.
  173.                If there is an associated label string, the  first
  174.                character  of the string value is ``|'' for a cen-
  175.                tered string, ``<'' for a leftstring or ``>''  for
  176.                a  rightstring  (see  below), followed by "_s_t_r_i_n_g"
  177.                for a constant  string  or  {_e_x_p_r}  for  a  string
  178.                expression.   A  constant  string may be preceeded
  179.                with a backslash (`\').  In this case the constant
  180.                string  will  be  used  as  a  ``wheel'' to fill a
  181.                column, e.g. "\-" for a  line  in  a  column,  and
  182.                "\Yeh "  for  "Yeh Yeh Ye".   If  the  cell  has a
  183.                numeric value, it follows as [_v_a_l_u_e], which may be
  184.                a constant or expression.
  185.  
  186.           x    Encryption.  See the -x option.
  187.  
  188.           $    Dollar prescale.  If  enabled,  all  numeric  con-
  189.                stants  (not expressions) which you enter are mul-
  190.                tipled by 0.01 so you don't have  to  keep  typing
  191.                the  decimal  point  if  you  enter lots of dollar
  192.  
  193.  
  194.  
  195.                                                                 3
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. SC 6.21 (1)              USER COMMANDS                SC 6.21 (1)
  203.  
  204.  
  205.  
  206.                figures.
  207.  
  208.           r    Newline action.  This option toggles between three
  209.                cases.   The default is no action.  If this option
  210.                is used once, after each  command  which  is  ter-
  211.                minated  by  a newline character is completed, the
  212.                current cell will be moved down one row.  If  this
  213.                option  is used again, after each command which is
  214.                terminated by a newline  character  is  completed,
  215.                the  current  cell will be moved right one column.
  216.                Another  use  of  this  option  will  restore  the
  217.                default action.
  218.  
  219.           z    Set newline action limits.  This option sets  lim-
  220.                its to the newline action option above.  When this
  221.                option is invoked,  the  row  and  column  of  the
  222.                current  cell  are remembered.  If a later newline
  223.                action would take the current cell to the right of
  224.                the  remembered  column,  then the current cell is
  225.                instead moved to the first column of the next row.
  226.                If  a  newline  action would take the current cell
  227.                below the remembered row, then the current cell is
  228.                instead moved to the top row of the next column.
  229.  
  230.           The quick numeric entry, newline action and set newline
  231.           action  limits  options  can  be combined to allow very
  232.           quick entry of large amounts of data.  If all the  data
  233.           to be entered is in a single row or column then setting
  234.           the quick numeric entry  and  the  appropriate  newline
  235.           action will allow the numbers to be entered without any
  236.           explicit commands to position the current cell or enter
  237.           a number.
  238.  
  239.           If the data entry involves several entries in each  row
  240.           for  many  rows,  then  setting the quick numeric entry
  241.           option, setting the newline action to move right  after
  242.           each entry and setting the newline action limits on the
  243.           last column on which data should be entered will  allow
  244.           the  data  to  entered  quickly.  If necessary, columns
  245.           which do not need data to be entered can be hidden with
  246.           the  z  command.   Similar arrangements can be made for
  247.           entering several rows of data in each column.
  248.  
  249.      S    Set options.  This command allows you  to  set  various
  250.           options.  A small menu lists the options that cannot be
  251.           changed through ^_T above.
  252.  
  253.           byrows/bycols
  254.                Specify the order cell evaluation  when  updating.
  255.                These options also affect the order in which cells
  256.                are filled (see /_f) and whether a row or column is
  257.                cleared by an _x command.
  258.  
  259.  
  260.  
  261.                                                                 4
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. SC 6.21 (1)              USER COMMANDS                SC 6.21 (1)
  269.  
  270.  
  271.  
  272.           iterations=_n
  273.                Set the maximum number  of  recalculations  before
  274.                the  screen  is displayed again. _I_t_e_r_a_t_i_o_n_s is set
  275.                to 10 by default.
  276.  
  277.           tblstyle=_s
  278.                Control the output of the _T command.  _s can be:  0
  279.                (default)  to give colon delimited fields, with no
  280.                _t_b_l control lines; tbl  to  give  colon  delimited
  281.                fields, with _t_b_l(1) control lines; latex to give a
  282.                _L_a_T_e_X tabular environment; slatex to give a _S_L_a_T_e_X
  283.                (_S_c_a_n_d_i_n_a_v_i_a_n  _L_a_T_e_X)  tabular environment; tex to
  284.                give a _T_e_X simple tabbed alignment with ampersands
  285.                as delimiters; and frame to give a tblstyle output
  286.                for FrameMaker.
  287.  
  288.           Other _S_e_t options are normally used  only  in  _s_c  data
  289.           files  since  they  are  available through ^_T.  You can
  290.           also use them interactively
  291.  
  292.           autocalc/!autocalc
  293.                Set/clear auto recalculation mode.
  294.  
  295.           numeric/!numeric
  296.                Set/clear numeric mode.
  297.  
  298.           prescale/!prescale
  299.                Set/clear numeric prescale mode.
  300.  
  301.           extfun/!extfun
  302.                Enable/disable external functions.
  303.  
  304.           cellcur/!cellcur
  305.                Set/clear current cell highlighting mode.
  306.  
  307.           toprow/!toprow
  308.                Set/clear top row display mode.
  309.  
  310.           rndinfinity/!rndinfinity
  311.                default: round-to-even (banker's round), *.5  will
  312.                round  to  the  closest  even number; doing a 'set
  313.                rndinfinity' will round *.5 up to the next integer
  314.                (rounding to infinity).
  315.  
  316.           craction=_n
  317.                Set the newline action.  _n can be: 0 (default)  to
  318.                give  no  action; 1 to move down after each entry;
  319.                or 2 to move right after each entry.
  320.  
  321.           rowlimit=_n
  322.                Set the remembered limit for the maximum row below
  323.                which the current cell will be moved to the top of
  324.  
  325.  
  326.  
  327.                                                                 5
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. SC 6.21 (1)              USER COMMANDS                SC 6.21 (1)
  335.  
  336.  
  337.  
  338.                the next column if the newline action  is  set  to
  339.                move the current cell down.  _n can be -1 (default)
  340.                to disable this facility.
  341.  
  342.           collimit=_n
  343.                Set the remembered limit for the maximum column to
  344.                the  right of which the current cell will be moved
  345.                to the left of the next row if the newline  action
  346.                is  set  to move the current cell right.  _n can be
  347.                -1 (default) to disable this facility.
  348.  
  349.   Cursor Control Commands
  350.  
  351.      ^P   Move the cell cursor up to the previous row.
  352.  
  353.      ^N   Move the cell cursor down to the next row.
  354.  
  355.      ^B   Move the cell cursor backward one column.
  356.  
  357.      ^F   Move the cell cursor forward one column.
  358.  
  359.      h, j, k, l
  360.           If the character cursor is not on the top  line,  these
  361.           are   alternate,  _v_i-compatible  cell  cursor  controls
  362.           (left, down, up, right).  Space is just like l (right).
  363.  
  364.      H, J, K, L
  365.           If the character cursor is not on the top  line,  these
  366.           move the cursor by half pages (left, down, up, right).
  367.  
  368.      ^H   If the character cursor is not on the top line,  ^_H  is
  369.           the same as ^_B.
  370.  
  371.      SPACE
  372.           If the character cursor is not on  the  top  line,  the
  373.           space bar is the same as ^_F.
  374.  
  375.      TAB  If the character cursor is on the top line, TAB  starts
  376.           a range (see below).  Otherwise, it is the same as ^_F.
  377.  
  378.      Arrow Keys
  379.           The terminal's arrow keys provide another alternate set
  380.           of cell cursor controls if they exist and are supported
  381.           in the appropriate _t_e_r_m_c_a_p entry.  Some terminals  have
  382.           arrow keys which conflict with other control key codes.
  383.           For example, a terminal might send  ^_H  when  the  back
  384.           arrow  key is pressed.  In these cases, the conflicting
  385.           arrow key performs the same function as the key  combi-
  386.           nation it mimics.
  387.  
  388.      ^    Move the cell cursor up to row 0 of the current column.
  389.  
  390.  
  391.  
  392.  
  393.                                                                 6
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. SC 6.21 (1)              USER COMMANDS                SC 6.21 (1)
  401.  
  402.  
  403.  
  404.      #    Move the cell cursor down to the last valid row of  the
  405.           current column.
  406.  
  407.      0    Move the cell  cursor  backward  to  column  A  of  the
  408.           current  row.  This command must be prefixed with ^_U if
  409.           quick numeric entry mode is enabled.
  410.  
  411.      $    Move the cell cursor forward to the last  valid  column
  412.           of the current row.
  413.  
  414.      b    Scan the cursor backward (left and up) to the  previous
  415.           valid cell.
  416.  
  417.      w    Scan the cursor forward (right and down)  to  the  next
  418.           valid cell.
  419.  
  420.      ^E_d  Go to end of range.  Follow ^_E by a direction indicator
  421.           such  as  ^_P or _j.  If the cell cursor starts on a non-
  422.           blank cell, it goes in the  indicated  direction  until
  423.           the  last  non-blank adjacent cell.  If the cell cursor
  424.           starts on a blank cell, it goes in the indicated direc-
  425.           tion  until  the first non-blank cell.  This command is
  426.           useful when specifying ranges of  adjacent  cells  (see
  427.           below),  especially  when  the range is bigger than the
  428.           visible window.
  429.  
  430.      g    Go to a cell.  _s_c prompts for a cell's name, a  regular
  431.           expression  surrounded  by  quotes,  or a number.  If a
  432.           cell's name such as _a_e_1_2_2 or a the name  of  a  defined
  433.           range  is  given, the cell cursor goes directly to that
  434.           cell.  If a quoted regular expression  such  as  "  _T_a_x
  435.           _T_a_b_l_e " or " ^_J_a_n [_0-_9]*$ " is given, _s_c searches for a
  436.           cell containing a string matching the  regular  expres-
  437.           sion.   See  _r_e_g_e_x(_3)  or _e_d(_1) for more details on the
  438.           form of regular expressions.  If a number is given,  _s_c
  439.           will   search   for  a  cell  containing  that  number.
  440.           Searches for either strings or numbers proceed  forward
  441.           from  the  current cell, wrapping back to a0 at the end
  442.           of the table, and terminate at the current cell if  the
  443.           string  or  number  is not found.  You may also go to a
  444.           cell with an ERROR (divide by zero, etc in  this  cell)
  445.           or  INVALID  (references  a  cell containing an ERROR).
  446.           _g _e_r_r_o_r  will  take  you  to  the  next  ERROR,   while
  447.           _g _i_n_v_a_l_i_d  take  you  to  the next invalid.  The last _g
  448.           command is saved, and  can  be  re-issued  by  entering
  449.           _g<_r_e_t_u_r_n>.
  450.  
  451.   Cell Entry and Editing Commands
  452.      Cells can contain both a numeric value and a  string  value.
  453.      Either  value  can  be  the result of an expression, but not
  454.      both at once, i.e. each cell can have  only  one  expression
  455.      associated  with  it.   Entering  a valid numeric expression
  456.  
  457.  
  458.  
  459.                                                                 7
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. SC 6.21 (1)              USER COMMANDS                SC 6.21 (1)
  467.  
  468.  
  469.  
  470.      alters the  cell's  previous  numeric  value,  if  any,  and
  471.      replaces  the  cell's  previous  string  expression, if any,
  472.      leaving only the previously computed constant label  string.
  473.      Likewise,  entering  a  valid  string  expression alters the
  474.      cell's the previous label string, if any, and  replaces  the
  475.      cell's previous numeric expression, if any, leaving only the
  476.      previously computed constant numeric value.
  477.  
  478.      =    Enter a numeric constant or expression into the current
  479.           cell.   _s_c  prompts for the expression on the top line.
  480.           The usual way to enter a number into a cell is to  type
  481.           ``='',  then enter the number in response to the prompt
  482.           on the top  line.   The  quick  numeric  entry  option,
  483.           enabled  through the -n option or ^_T command, shows the
  484.           prompt when you enter the first digit of a number  (you
  485.           can skip typing ``='').
  486.  
  487.      <    Enter a label  string  into  the  current  cell  to  be
  488.           flushed left against the left edge of the cell.
  489.  
  490.      "    Enter a label string into the current cell to  be  cen-
  491.           tered in the column.
  492.  
  493.      >    Enter a label  string  into  the  current  cell  to  be
  494.           flushed right against the right edge of the cell.
  495.  
  496.      F    Enter a format string into the current cell.  This for-
  497.           mat  string  overrides the precision specified with the
  498.           ``f'' command.  The  format  only  applies  to  numeric
  499.           values.   The following characters can be used to build
  500.           a format string:
  501.  
  502.           #    Digit placeholder.  If the number has fewer digits
  503.                on  either  side  of the decimal point than  there
  504.                are `#' characters in the format,  the  extra  `#'
  505.                characters  are ignored.  The number is rounded to
  506.                the number of digit placeholders as there  are  to
  507.                the right of the decimal point.  If there are more
  508.                digits in the number than there are  digit  place-
  509.                holders  on  the  left  side of the decimal point,
  510.                then those digits are displayed.
  511.  
  512.           0    Digit placeholder.  Same as for  `#'  except  that
  513.                the number is padded with zeroes on either side of
  514.                the decimal point.  The number of zeroes  used  in
  515.                padding  is  determined  by  the  number  of digit
  516.                placeholders after the `0' for digits on the  left
  517.                side  of  the  decimal  point and by the number of
  518.                digit placeholders before the `0'  for  digits  on
  519.                the right side of the decimal point.
  520.  
  521.           .    Decimal point.  Determines  how  many  digits  are
  522.  
  523.  
  524.  
  525.                                                                 8
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. SC 6.21 (1)              USER COMMANDS                SC 6.21 (1)
  533.  
  534.  
  535.  
  536.                placed  on the right and left sides of the decimal
  537.                point in the number.  Note  that  numbers  smaller
  538.                than 1 will begin with a decimal point if the left
  539.                side of the decimal  point  contains  only  a  `#'
  540.                digit placeholder.  Use a `0' placeholder to get a
  541.                leading zero in decimal formats.
  542.  
  543.           %    Percentage.  For each `%' character in the format,
  544.                the actual number gets multiplied by 100 (only for
  545.                purposes of formatting -- the original  number  is
  546.                left  unmodified)  and the `%' character is placed
  547.                in the same position as it is in the format.
  548.  
  549.           ,    Thousands separator.  The presence of a `,' in the
  550.                format  (multiple  commas are treated as one) will
  551.                cause the  number  to  be  formatted  with  a  `,'
  552.                separating each set of three digits in the integer
  553.                part of the number with numbering  beginning  from
  554.                the right end of the integer.
  555.  
  556.           \    Quote.  This character causes the  next  character
  557.                to  be inserted into the formatted string directly
  558.                with no special interpretation.
  559.  
  560.           E- E+ e- e+
  561.                Scientific format.  Causes the number to formatted
  562.                in  scientific  notation.   The case of the `E' or
  563.                `e' given is preserved.  If the format uses a `+',
  564.                then  the  sign  is  always given for the exponent
  565.                value.  If the format uses a `-', then the sign is
  566.                only  given  when  the exponent value is negative.
  567.                Note that if there is no digit placeholder follow-
  568.                ing  the `+' or `-', then that part of the format-
  569.                ted number is left out.  In general, there  should
  570.                be one or more digit placeholders after the `+' or
  571.                `-'.
  572.  
  573.           ;    Format selector.  Use this character  to  separate
  574.                the  format into two distinct formats.  The format
  575.                to the left of the `;' character will be  used  if
  576.                the  number given is zero or positive.  The format
  577.                to the right of the `;' character is used  if  the
  578.                number given is negative.
  579.  
  580.           Some example formats  are  integer  (``0''  or  ``#''),
  581.           fixed  (``0.00''),  percentage  (``0%''  or ``0.00%''),
  582.           scientific      (``0.00E+00''),      and       currency
  583.           (``$#,0.00;($#,0.00)'').
  584.  
  585.      Strings you enter must start with ".  You can leave off  the
  586.      trailing " and _s_c will add it for you.  You can also enter a
  587.      string expression by backspacing over the opening "  in  the
  588.  
  589.  
  590.  
  591.                                                                 9
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598. SC 6.21 (1)              USER COMMANDS                SC 6.21 (1)
  599.  
  600.  
  601.  
  602.      prompt.
  603.  
  604.      e    Edit the value associated with the current cell.   This
  605.           is  identical  to  ``=''  except  that the command line
  606.           starts out containing the old numeric value or  expres-
  607.           sion  associated  with  the  cell.  The editing in this
  608.           mode is vi-like.
  609.  
  610.           ^h   Move back a character
  611.  
  612.           +    Forward through history (neat) (same as j)
  613.  
  614.           -    Backward through history (neat) (same as k)
  615.  
  616.           ESC  Done editing
  617.  
  618.           TAB  Mark && append a range (ex: A0:A0)
  619.                TAB, move around within a range; TAB, append range
  620.                string.
  621.  
  622.           CR   Save
  623.  
  624.           $    Goto last column
  625.  
  626.           .    Insert current dot buffer
  627.  
  628.           /    Search for a string in the history
  629.                ESC  edit the string you typed
  630.                CR   search
  631.                ^h   backspace
  632.  
  633.           0    Goto column 0
  634.  
  635.           D    Delete to send
  636.  
  637.           I    Insert at column 0; ESC revert back to edit mode
  638.  
  639.           R    Replace mode; ESC revert back to edit mode
  640.  
  641.           X    Delete the char to the left
  642.  
  643.           a    Append after cursor; ESC revert back to edit mode
  644.  
  645.           b    Move back a word
  646.  
  647.           c    Change mode; ESC revert back to edit mode
  648.  
  649.           d    Delete ...
  650.                b    back word
  651.                f    forward (right)
  652.                h    back char
  653.                l    forward
  654.  
  655.  
  656.  
  657.                                                                10
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664. SC 6.21 (1)              USER COMMANDS                SC 6.21 (1)
  665.  
  666.  
  667.  
  668.                t    delete forward up to a given char (next  char
  669.                typed)
  670.                w    delete next word forward
  671.  
  672.           f    Find the next char typed
  673.  
  674.           h    Move left a char
  675.  
  676.           i    Insert before cursor; ESC revert back to edit mode
  677.  
  678.           j    Forward through history (neat) (same as +)
  679.  
  680.           k    Backward through history (neat) (same as -)
  681.  
  682.           l    Move right a char
  683.  
  684.           n    Continue search
  685.  
  686.           q    Stop editing
  687.  
  688.           r    Replace char
  689.  
  690.           t    Goto a char
  691.  
  692.           u    Undo
  693.  
  694.           w    Forward a word
  695.  
  696.           x    Delete the current char (moving to the right)
  697.  
  698.      E    Edit the string associated with the current cell.  This
  699.           is  identical to ``<'', ``"'', or ``>'' except that the
  700.           command line starts out containing the old string value
  701.           or expression associated with the cell.  SEE e ABOVE.
  702.  
  703.      To enter and edit a cell's number part, use the ``='' and  _e
  704.      commands.   To  enter and edit a cell's string part, use the
  705.      ``<'', ``"'', ``>'', and _E commands.  See the sections below
  706.      on numeric and string expressions for more information.
  707.  
  708.      x    Clear the current cell.   Deletes  the  numeric  value,
  709.           label string, and/or numeric or string expression.  You
  710.           can prefix this command with a count of the  number  of
  711.           cells  on the current row to clear.  The current column
  712.           is used if column recalculation order  is  set.   Cells
  713.           cleared  with  this command may be recalled with any of
  714.           the _p_u_l_l commands (see below).
  715.  
  716.      m    Mark a cell to be used as the source for the _c_o_p_y  com-
  717.           mand.
  718.  
  719.      c    Copy the last marked cell to the current cell, updating
  720.  
  721.  
  722.  
  723.                                                                11
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730. SC 6.21 (1)              USER COMMANDS                SC 6.21 (1)
  731.  
  732.  
  733.  
  734.           row  and  column  references  in  its numeric or string
  735.           expression, if any.
  736.  
  737.      +    If not in numeric mode, add the current  numeric  argu-
  738.           ment  (default 1) to the value of the current cell.  In
  739.           numeric mode, ``+'' introduces a new numeric expression
  740.           or value, the same as ``=''.
  741.  
  742.      -    If not in numeric mode, subtract  the  current  numeric
  743.           argument  (default  1)  from  the  value of the current
  744.           cell.  In numeric mode, ``-'' introduces a  new,  nega-
  745.           tive, numeric expression or value, like ``=''.
  746.  
  747.      RETURN
  748.           If you are not editing a  cell  (top  line  is  empty),
  749.           pressing RETURN will make _s_c enter insert mode. At this
  750.           point you may type any valid command or press ESC  once
  751.           to edit.
  752.  
  753.   File Commands
  754.  
  755.      G    Get a new database  from  a  file.   If  encryption  is
  756.           enabled, the file is decrypted before it is loaded into
  757.           the spreadsheet.
  758.  
  759.      P    Put the current database into a file.  If encryption is
  760.           enabled, the file is encrypted before it is saved.
  761.  
  762.      W    Write a listing of the current database into a file  in
  763.           a form that matches its appearance on the screen.  This
  764.           differs from the _P_u_t command  in  that  its  files  are
  765.           intended  to be reloaded with _G_e_t, while _W_r_i_t_e produces
  766.           a file for people to look at.  Hidden rows  or  columns
  767.           are not shown when the data is printed.
  768.  
  769.      T    Write a listing of the current database to a file,  but
  770.           include  delimiters suitable for processing by the _t_b_l,
  771.           _L_a_T_e_X, or _T_e_X table  processors.   The  delimiters  are
  772.           controlled by the _t_b_l_s_t_y_l_e option.  See _S_e_t above.  The
  773.           delimiters are are a colon (:) for style _0 or  _t_b_l  and
  774.           an ampersand (&) for style _l_a_t_e_x or _t_e_x.
  775.  
  776.      With the _P_u_t, _W_r_i_t_e, and _T_a_b_l_e commands, the optional  range
  777.      argument  writes  a  subset of the spreadsheet to the output
  778.      file.
  779.  
  780.      With the _W_r_i_t_e and _T_a_b_l_e commands, if you try  to  write  to
  781.      the last file used with the _G_e_t or _P_u_t commands, or the file
  782.      specified on the command line when _s_c was invoked,  you  are
  783.      asked  to confirm that the (potentially) dangerous operation
  784.      is really what you want.
  785.  
  786.  
  787.  
  788.  
  789.                                                                12
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796. SC 6.21 (1)              USER COMMANDS                SC 6.21 (1)
  797.  
  798.  
  799.  
  800.      The three output commands, _P_u_t, _W_r_i_t_e, and _T_a_b_l_e,  can  pipe
  801.      their  (unencrypted  only) output to a program.  To use this
  802.      feature, enter ``| program'' to  the  prompt  asking  for  a
  803.      filename.   For example, to redirect the output of the _W_r_i_t_e
  804.      command to the printer, you might enter ``| lpr -p''.
  805.  
  806.      M    Merge the database from the named file into the current
  807.           database.   Values and expressions defined in the named
  808.           file are read into the current spreadsheet  overwriting
  809.           the existing entries at matching cell locations.
  810.  
  811.      R    Run macros.  Since _s_c files are saved as  ASCII  files,
  812.           it  is  possible to use them as primitive macro defini-
  813.           tion files.  The _R_u_n command makes this  easier.   It's
  814.           like the _M_e_r_g_e command, but prints a saved path name as
  815.           the start of the filename to merge in.  The  string  to
  816.           use  is  set with the _D_e_f_i_n_e command.  To write macros,
  817.           you must be familiar with the file  format  written  by
  818.           the  _P_u_t command.  This facility is still primitive and
  819.           could be much improved.
  820.  
  821.      D    Define a path for the _R_u_n command to use.
  822.  
  823.      All file operations take a filename as the first argument to
  824.      the  prompt on the top line.  The prompt supplies a " to aid
  825.      in typing  in  the  filename.   The  filename  can  also  be
  826.      obtained  from  a  cell's label string or string expression.
  827.      In this case, delete the leading " with  the  backspace  key
  828.      and enter a cell name such as _a_2_2 instead.  If the resulting
  829.      string starts with ``|'', the rest of the string  is  inter-
  830.      preted as a UNIX command, as above.
  831.  
  832.   Row and Column Commands
  833.      These commands can be used on either rows or  columns.   The
  834.      second letter of the command is either a row designator (one
  835.      of the characters _r, ^_B, ^_F, _h, _l) or  a  column  designator
  836.      (one  of  _c,  ^_P, ^_N, _k, _j).  A small menu lists the choices
  837.      for the second letter when you type the first letter of  one
  838.      of  these  commands.  Commands which move or copy cells also
  839.      modify the  row  and  column  references  in  affected  cell
  840.      expressions.   The  references  may  be  frozen by using the
  841.      _f_i_x_e_d operator or using the $ character in the reference  to
  842.      the cell (see below).
  843.  
  844.      ir, ic
  845.           Insert a new row (column) by moving  the  row  (column)
  846.           containing  the  cell  cursor,  and  all following rows
  847.           (columns), down (right) one row (column).  The new  row
  848.           (column) is empty.
  849.  
  850.      ar, ac
  851.           Append a new row  (column)  immediately  following  the
  852.  
  853.  
  854.  
  855.                                                                13
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862. SC 6.21 (1)              USER COMMANDS                SC 6.21 (1)
  863.  
  864.  
  865.  
  866.           current  row  (column).  It is initialized as a copy of
  867.           the current one.
  868.  
  869.      dr, dc
  870.           Delete the current row (column).
  871.  
  872.      pr, pc, pm
  873.           Pull deleted rows (columns) back into the  spreadsheet.
  874.           The  last  deleted  set  of  cells is put back into the
  875.           spreadsheet at the current location.  _p_r inserts enough
  876.           rows  to  hold  the data.  _p_c inserts enough columns to
  877.           hold the data.  _p_m (merge)  does  not  insert  rows  or
  878.           columns;  it  overwrites  the  cells  beginning  at the
  879.           current cell cursor location.
  880.  
  881.      vr, vc
  882.           Remove expressions from the  affected  rows  (columns),
  883.           leaving  only the values which were in the cells before
  884.           the command was executed.
  885.  
  886.      zr, zc
  887.           Hide (``zap'') the current row (column).  This keeps  a
  888.           row  (column)  from being displayed but keeps it in the
  889.           data base.  The status of the rows and columns is saved
  890.           with  the  data base so hidden rows and columns will be
  891.           still be hidden when you reload the spreadsheet.   Hid-
  892.           den rows or columns are not printed by the _W command.
  893.  
  894.      sr, sc
  895.           Show hidden rows (columns).   Enter  a  range  of  rows
  896.           (columns)  to  be  revealed.   The default is the first
  897.           range of rows (columns) currently hidden.  This command
  898.           ignores the repeat count, if any.
  899.  
  900.      f    Set the output format  to  be  used  for  printing  the
  901.           numeric  values  in  each  cell  in the current column.
  902.           Enter three numbers: the total width in  characters  of
  903.           the  column,  the  number  of  digits to follow decimal
  904.           points, and the format type.  Format types  are  0  for
  905.           fixed point, 1 for scientific notation, 2 for engineer-
  906.           ing notation, and 3 for dates.  Values are rounded  off
  907.           to  the  least  significant digit displayed.  The total
  908.           column width affects displays of  strings  as  well  as
  909.           numbers.   A preceding count can be used to affect more
  910.           than one column.  This command has only a  column  ver-
  911.           sion (no second letter).
  912.  
  913.      @myrow, @mycol
  914.           Are functions that return the  row  or  column  of  the
  915.           current cell respectively.  ex: The cell directly above
  916.           a cell in the  D  column  could  then  be  accessed  by
  917.           @nval("d",@myrow-1).   NOTE: @myrow and @mycol can't be
  918.  
  919.  
  920.  
  921.                                                                14
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928. SC 6.21 (1)              USER COMMANDS                SC 6.21 (1)
  929.  
  930.  
  931.  
  932.           used in specifying ranges.
  933.  
  934.   Range Commands
  935.      Range operations affect a rectangular region on  the  screen
  936.      defined  by  the  upper  left  and  lower right cells in the
  937.      region.  All of the commands in  this  class  start  with  a
  938.      slash; the second letter of the command indicates which com-
  939.      mand.  A small menu lists the choices for the second  letter
  940.      when  you  type ``/''.  _s_c prompts for needed parameters for
  941.      each command.  Phrases surrounded by square brackets in  the
  942.      prompt  are  informational  only  and may be erased with the
  943.      backspace key.
  944.  
  945.      Prompts requesting variable  names  may  be  satisfied  with
  946.      either  an  explicit  variable  name, such as _A_1_0, or with a
  947.      variable name  previously  defined  in  a  /_d  command  (see
  948.      below).  Range name prompts require either an explicit range
  949.      such as _A_1_0:_B_2_0, or a range name previously defined  with  a
  950.      /_d  command.   A  default  range shown in the second line is
  951.      used if you omit the range from the command or press the TAB
  952.      key (see below).  The default range can be changed by moving
  953.      the cell cursor via the control commands (^_P, ^_N, ^_B, ^_F) or
  954.      the  arrow  keys.   The  cells  in  the  default  range  are
  955.      highlighted (using the terminal's standout mode,  if  avail-
  956.      able).
  957.  
  958.      /x   Clear a range.  Cells cleared with this command may  be
  959.           recalled with any of the _p_u_l_l commands.
  960.  
  961.      /v   Values only.  This command removes the expressions from
  962.           a  range  of  cells,  leaving  just  the  values of the
  963.           expressions.
  964.  
  965.      /c   Copy a source range to a destination range.  The source
  966.           and  destination may be different sizes.  The result is
  967.           always one or more full copies of the source.   Copying
  968.           a  row  to  a  row yields a row.  Copying a column to a
  969.           column yields a column.  Copying a  range  to  anything
  970.           yields  a range.  Copying a row to a column or a column
  971.           to a row yields a range with  as  many  copies  of  the
  972.           source  as  there  are  cells in the destination.  This
  973.           command can be used to  duplicate  a  cell  through  an
  974.           arbitrary  range  by  making  the  source a single cell
  975.           range such as _b_2_0:_b_2_0.
  976.  
  977.      /f   Fill a range with constant values starting with a given
  978.           value and increasing by a given increment.  Each row is
  979.           filled before moving on to the next row  if  row  order
  980.           recalculation  is  set.  Column order fills each column
  981.           in the range before moving on to the next column.   The
  982.           start  and  increment  numbers may be positive or nega-
  983.           tive.  To fill all cells with the same value,  give  an
  984.  
  985.  
  986.  
  987.                                                                15
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994. SC 6.21 (1)              USER COMMANDS                SC 6.21 (1)
  995.  
  996.  
  997.  
  998.           increment of zero.
  999.  
  1000.      /d   Use this command to assign a symbolic name to a  single
  1001.           cell  or  a  rectangular  range of cells on the screen.
  1002.           The parameters are the  name,  surrounded  by  "",  and
  1003.           either  a  single cell name such as _A_1_0 or a range such
  1004.           as _a_1:_b_2_0.  Names defined in this fashion are  used  by
  1005.           the  program  in  future  prompts,  may  be  entered in
  1006.           response to prompts requesting a cell  or  range  name,
  1007.           and  are  saved  when the spreadsheet is saved with the
  1008.           _P_u_t command.  Names defined must be more than two alpha
  1009.           characters  long  to  differentiate  them from a column
  1010.           names, and must not have embedded  special  characters.
  1011.           Names  may  include  the character ``_'' or numerals as
  1012.           long as they occur after the first three alpha  charac-
  1013.           ters.
  1014.  
  1015.      /l   Use this command to lock the current cell or a range of
  1016.           cells,  i.e  make them immune to any type of editing. A
  1017.           locked cell can't be changed  in  anyway  until  it  is
  1018.           unlocked.
  1019.  
  1020.      /U   This command is the opposite of the /_l command and thus
  1021.           unlocks a locked cell and makes it editable.
  1022.  
  1023.      /s   This command lists (shows) the currently defined  range
  1024.           names.   If  there  are  no defined range names, then a
  1025.           message is given, otherwise it pipes  output  to  _s_o_r_t,
  1026.           then  to  _l_e_s_s.   If  the environment variable PAGER is
  1027.           set, its value is used in place of _l_e_s_s.
  1028.  
  1029.      /u   Use this command to undefine a previously defined range
  1030.           name.
  1031.  
  1032.      /F   Use this command to assign a value format  string  (see
  1033.           the ``F'' cell entry command) to a range of cells.
  1034.  
  1035.   Miscellaneous Commands
  1036.  
  1037.      Q
  1038.      q
  1039.      ^C   Exit from _s_c.  If you made any changes since  the  last
  1040.           _G_e_t or _P_u_t, _s_c asks about saving your data before exit-
  1041.           ing.
  1042.  
  1043.      ^G
  1044.      ESC  Abort entry of the current command.
  1045.  
  1046.      ?    Enter an interactive help facility.  Lets you  look  up
  1047.           brief  summaries  of  the main features of the program.
  1048.           The help facility is structured like this  manual  page
  1049.           so  it is easy to find more information on a particular
  1050.  
  1051.  
  1052.  
  1053.                                                                16
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060. SC 6.21 (1)              USER COMMANDS                SC 6.21 (1)
  1061.  
  1062.  
  1063.  
  1064.           topic.
  1065.  
  1066.      !    Shell escape.  _s_c prompts for a shell command  to  run.
  1067.           End  the  command  line  with  the  RETURN key.  If the
  1068.           environment variable SHELL is defined,  that  shell  is
  1069.           run.   If  not, /bin/sh is used.  Giving a null command
  1070.           line starts the shell in interactive  mode.   A  second
  1071.           ``!'' repeats the previous command.
  1072.  
  1073.      ^L   Redraw the screen.
  1074.  
  1075.      ^R   Redraw the screen with special highlighting of cells to
  1076.           be  filled  in.   This is useful for finding values you
  1077.           need to provide or update in  a  form  with  which  you
  1078.           aren't  familiar  or  of  which  you have forgotten the
  1079.           details.
  1080.  
  1081.           It's also useful for checking a form you are  creating.
  1082.           All  cells  which  contain constant numeric values (not
  1083.           the result of a  numeric  expression)  are  highlighted
  1084.           temporarily,  until  the  next  screen  change, however
  1085.           minor.  To avoid ambiguity, the current range (if  any)
  1086.           and current cell are not highlighted.
  1087.  
  1088.      ^X   This command is similar to  ^_R,  but  highlights  cells
  1089.           which  have  expressions.  It also displays the expres-
  1090.           sions in the highlighted cells as left-flushed strings,
  1091.           instead  of  the numeric values and/or label strings of
  1092.           those cells.  This command makes  it  easier  to  check
  1093.           expressions,  at  least when they fit in their cells or
  1094.           the following cell(s) are blank so the expressions  can
  1095.           slop  over  (like  label strings).  In the latter case,
  1096.           the slop over is not cleared on the next screen update,
  1097.           so  you  may  want  to type ^_L after the ^_X in order to
  1098.           clean up the screen.
  1099.  
  1100.      @    Recalculates the spreadsheet.
  1101.  
  1102.      ^V   Type, in the command line, the name of the current cell
  1103.           (the  one  at  the  cell  cursor).  This is useful when
  1104.           entering expressions which refer to other cells in  the
  1105.           table.
  1106.  
  1107.      ^W   Type, in the command line, the expression  attached  to
  1108.           the  current  cell.   If  there  is none, the result is
  1109.           ``?''.
  1110.  
  1111.      ^A   Type, in the command line, the  numeric  value  of  the
  1112.           current cell, if any.
  1113.  
  1114.      The ^_V, ^_W, and ^_A commands only  work  when  the  character
  1115.      cursor   is  on  the  command  line  and  beyond  the  first
  1116.  
  1117.  
  1118.  
  1119.                                                                17
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126. SC 6.21 (1)              USER COMMANDS                SC 6.21 (1)
  1127.  
  1128.  
  1129.  
  1130.      character.
  1131.  
  1132.      TAB  When the character cursor is on the top line, defines a
  1133.           range  of  cells via the cursor control commands or the
  1134.           arrow keys.  The range is highlighted,  starts  at  the
  1135.           cell  where  you  typed  TAB, and continues through the
  1136.           current cell cursor.  Pressing  TAB  again  causes  the
  1137.           highlighted  range  to be entered into the command line
  1138.           and the highlighting to be turned off.   This  is  most
  1139.           useful for defining ranges to functions such as @_s_u_m().
  1140.           Pressing ``)'' acts just like typing the  TAB  key  the
  1141.           second time and adds the closing ``)''.  Note that when
  1142.           you give a range command, you don't need to  press  the
  1143.           first  TAB  to begin defining a range starting with the
  1144.           current cell.
  1145.  
  1146.   Variable Names
  1147.      Normally, a variable name is just the name of a  cell,  such
  1148.      as  _K_2_0.   The  value  is the numeric or string value of the
  1149.      cell, according to context.
  1150.  
  1151.      When a cell's expression  (formula)  is  copied  to  another
  1152.      location  via _c_o_p_y or _r_a_n_g_e-_c_o_p_y, variable references are by
  1153.      default offset by the amount the formula moved.  This allows
  1154.      the new formula to work on new data.  If cell references are
  1155.      not to change, you can either use the  _f_i_x_e_d  operator  (see
  1156.      below), or one of the following variations on the cell name.
  1157.  
  1158.      _K_2_0  References cell _K_2_0; the  reference  changes  when  the
  1159.           formula is copied.
  1160.  
  1161.      $_K$_2_0
  1162.           Always refers to cell _K_2_0; the  reference  stays  fixed
  1163.           when the formula is copied.
  1164.  
  1165.      $_K_2_0 Keeps the column fixed at column K; the row is free  to
  1166.           vary.
  1167.  
  1168.      _K$_2_0 Similarly, this fixes the row and allows the column  to
  1169.           vary.
  1170.  
  1171.      These conventions also hold on defined ranges.  Range refer-
  1172.      ences vary when formulas containing them are copied.  If the
  1173.      range is defined with fixed variable references, the  refer-
  1174.      ences do not change.
  1175.  
  1176.      fixed
  1177.           To make a variable not change automatically when a cell
  1178.           moves,  put  the  word _f_i_x_e_d in front of the reference,
  1179.           for example: B1 * fixed C3.
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.                                                                18
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192. SC 6.21 (1)              USER COMMANDS                SC 6.21 (1)
  1193.  
  1194.  
  1195.  
  1196.   Numeric Expressions
  1197.      Numeric expressions used with the ``='' and _e commands  have
  1198.      a fairly conventional syntax.  Terms may be constants, vari-
  1199.      able names, parenthesized expressions,  and  negated  terms.
  1200.      Ranges may be operated upon with range functions such as sum
  1201.      (@_s_u_m()) and average (@_a_v_g()).  Terms may be combined  using
  1202.      binary operators.
  1203.  
  1204.      -e   Negation.
  1205.  
  1206.      e+e  Addition.
  1207.  
  1208.      e-e  Subtraction.
  1209.  
  1210.      e*e  Multiplication.
  1211.  
  1212.      e/e  Division.
  1213.  
  1214.      e1%e2
  1215.           e1 mod e2.
  1216.  
  1217.      e^e  Exponentiation.
  1218.  
  1219.      e<e
  1220.      e<=e
  1221.      e=e
  1222.      e!=e
  1223.      e>=e
  1224.      e>e  Relationals: true (1) if  and  only  if  the  indicated
  1225.           relation  holds,  else  false  (0).   Note that ``<='',
  1226.           ``!='', and  ``>=''  are  converted  to  their  ``~()''
  1227.           equivalents.
  1228.  
  1229.      ~e   Boolean operator NOT.
  1230.  
  1231.      e&e  Boolean operator AND.
  1232.  
  1233.      e|e  Boolean operator OR.
  1234.  
  1235.      @if(e,e,e)
  1236.      e?e:e
  1237.           Conditional: If the first expression is true  then  the
  1238.           value of the second is returned, otherwise the value of
  1239.           the third.
  1240.      Operator precedence from highest to lowest is:
  1241.           -, ~
  1242.           ^
  1243.           *, /
  1244.           +, -
  1245.           <, <=, =, !=, >=, >
  1246.           &
  1247.           |
  1248.  
  1249.  
  1250.  
  1251.                                                                19
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258. SC 6.21 (1)              USER COMMANDS                SC 6.21 (1)
  1259.  
  1260.  
  1261.  
  1262.           ?:
  1263.   Built-in Range Functions
  1264.      These functions return numeric values.
  1265.      @sum(r)           Sum all valid (nonblank)  entries  in  the
  1266.                        region  whose  two  corners are defined by
  1267.                        the two variable names (e.g.   _c_5:_e_1_4)  or
  1268.                        the range name specified.
  1269.      @prod(r)          Multiply  together  all  valid  (nonblank)
  1270.                        entries in the specified region.
  1271.      @avg(r)           Average all valid  (nonblank)  entries  in
  1272.                        the specified region.
  1273.      @count(r)         Count all valid (nonblank) entries in  the
  1274.                        specified region.
  1275.      @max(r)           Return the maximum value in the  specified
  1276.                        region.   See also the multi argument ver-
  1277.                        sion of @_m_a_x below.
  1278.      @min(r)           Return the minimum value in the  specified
  1279.                        region.   See also the multi argument ver-
  1280.                        sion of @_m_i_n below.
  1281.      @stddev(r)        Return the sample  standard  deviation  of
  1282.                        the cells in the specified region.
  1283.      @lookup(e,r)
  1284.      @lookup(se,r)     Evaluates  the  expression  then  searches
  1285.                        through  the range _r for a matching value.
  1286.                        The range should be either a single row or
  1287.                        a  single  column.   The expression can be
  1288.                        either a string expression  or  a  numeric
  1289.                        expression.   If  it  is a numeric expres-
  1290.                        sion, the range is searched  for  the  the
  1291.                        last  value  less  than or equal to _e.  If
  1292.                        the expression is a string expression, the
  1293.                        string  portions of the cells in the range
  1294.                        are searched for an  exact  string  match.
  1295.                        The  value  returned  is the numeric value
  1296.                        from the next row and the same  column  as
  1297.                        the  match, if the range was a single row,
  1298.                        or the value from the next column and  the
  1299.                        same  row  as the match if the range was a
  1300.                        single column.
  1301.  
  1302.      @hlookup(e,r,n)
  1303.      @hlookup(se,r,n)  Evaluates  the  expression  then  searches
  1304.                        through the first row in the range _r for a
  1305.                        matching value.   The  expression  can  be
  1306.                        either  a  string  expression or a numeric
  1307.                        expression.  If it is  a  numeric  expres-
  1308.                        sion, the row is searched for the the last
  1309.                        value less than or equal  to  _e.   If  the
  1310.                        expression  is  a  string  expression, the
  1311.                        string portions of the cells  in  the  row
  1312.                        are  searched  for  an exact string match.
  1313.                        The value returned is  the  numeric  value
  1314.  
  1315.  
  1316.  
  1317.                                                                20
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324. SC 6.21 (1)              USER COMMANDS                SC 6.21 (1)
  1325.  
  1326.  
  1327.  
  1328.                        from  the  same  column  _n  rows below the
  1329.                        match.
  1330.  
  1331.      @vlookup(e,r,n)
  1332.      @vlookup(se,r,n)  Evaluates  the  expression  then  searches
  1333.                        through  the  first  column in the range _r
  1334.                        for a matching value.  The expression  can
  1335.                        be either a string expression or a numeric
  1336.                        expression.  If it is  a  numeric  expres-
  1337.                        sion,  the  column is searched for the the
  1338.                        last value less than or equal  to  _e.   If
  1339.                        the expression is a string expression, the
  1340.                        string portions of the cells in the column
  1341.                        are  searched  for  an exact string match.
  1342.                        The value returned is  the  numeric  value
  1343.                        from  the  same row _n columns to the right
  1344.                        of the match.
  1345.  
  1346.      @index(e,r)       Use the value of the expression _e to index
  1347.                        into  the  range  _r.  The numeric value at
  1348.                        that position is  returned.  The  value  1
  1349.                        selects  the  first  item  in the range, 2
  1350.                        selects the second item, etc.  _R should be
  1351.                        either a single row or a single column.
  1352.  
  1353.      @stindex(e,r)     Use the value of _e to index into the range
  1354.                        _r.   The  string value at that position is
  1355.                        returned. The value 1  selects  the  first
  1356.                        item  in  the  range, 2 selects the second
  1357.                        item, etc.  The range should be  either  a
  1358.                        single row or a single column.
  1359.  
  1360.   Built-in Numeric Functions
  1361.      All of these functions operate  on  floating  point  numbers
  1362.      (doubles) and return numeric values.  Most of them are stan-
  1363.      dard system functions more fully described in _m_a_t_h(3).   The
  1364.      trig functions operate with angles in radians.
  1365.  
  1366.      @sqrt(e)          Return the square root of _e.
  1367.  
  1368.      @exp(e)           Return the exponential function of _e.
  1369.  
  1370.      @ln(e)            Return the natural logarithm of _e.
  1371.  
  1372.      @log(e)           Return the base 10 logarithm of _e.
  1373.  
  1374.      @floor(e)         Return the  largest  integer  not  greater
  1375.                        than _e.
  1376.  
  1377.      @ceil(e)          Return the smallest integer not less  than
  1378.                        _e.
  1379.  
  1380.  
  1381.  
  1382.  
  1383.                                                                21
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390. SC 6.21 (1)              USER COMMANDS                SC 6.21 (1)
  1391.  
  1392.  
  1393.  
  1394.      @rnd(e)           Round _e to the nearest integer.   default:
  1395.                        round-to-even  (banker's  round), *.5 will
  1396.                        round to the  closest  even  number;  'set
  1397.                        rndinfinity' will round *.5 up to the next
  1398.                        integer.
  1399.  
  1400.      @round(e,n)       Round _e to _n decimal  places.   n  may  be
  1401.                        positive  to  round  off the right side of
  1402.                        the decimal, and negative to round off the
  1403.                        left  side. See @rnd(e) above for rounding
  1404.                        types.
  1405.  
  1406.      @abs(e)
  1407.      @fabs(e)          Return the absolute value of _e.
  1408.      @pow(e1,e2)       Return _e_1 raised to the power of _e_2.
  1409.      @hypot(e1,e2)     Return sqrt(e1*e1+e2*e2),  taking  precau-
  1410.                        tions against unwarranted overflows.
  1411.      pi  @pi           A constant quite close to pi.
  1412.      @dtr(e)           Convert _e in degrees to radians.
  1413.      @rtd(e)           Convert _e in radians to degrees.
  1414.      @sin(e)
  1415.      @cos(e)
  1416.      @tan(e)           Return trigonometric functions  of  radian
  1417.                        arguments.  The magnitude of the arguments
  1418.                        are  not  checked  to  assure   meaningful
  1419.                        results.
  1420.  
  1421.      @asin(e)          Return the arc sine  of  _e  in  the  range
  1422.                        -pi/2 to pi/2.
  1423.  
  1424.      @acos(e)          Return the arc cosine of _e in the range  0
  1425.                        to pi.
  1426.  
  1427.      @atan(e)          Return the arc tangent of _e in  the  range
  1428.                        -pi/2 to pi/2.
  1429.  
  1430.      @atan2(e1,e2)     Returns the arc tangent of  _e_1/_e_2  in  the
  1431.                        range -pi to pi.
  1432.  
  1433.      @max(e1,e2,...)   Return the maximum of the  values  of  the
  1434.                        expressions.   Two or more expressions may
  1435.                        be specified.  See also the range  version
  1436.                        of @_m_a_x above.
  1437.  
  1438.      @min(e1,e2,...)   Return the minimum of the  values  of  the
  1439.                        expressions.   Two or more expressions may
  1440.                        be specified.  See also the range  version
  1441.                        of @_m_i_n above.
  1442.  
  1443.      @ston(se)         Convert string expression _s_e to a  numeric
  1444.                        value.
  1445.  
  1446.  
  1447.  
  1448.  
  1449.                                                                22
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456. SC 6.21 (1)              USER COMMANDS                SC 6.21 (1)
  1457.  
  1458.  
  1459.  
  1460.      @eqs(se1,se2)     Return 1 if string expression _s_e_1 has  the
  1461.                        same  value  as  string  expression _s_e_2, 0
  1462.                        otherwise.
  1463.  
  1464.      @nval(se,e)       Return  the  numeric  value  of   a   cell
  1465.                        selected  by  name.   String expression _s_e
  1466.                        must evaluate to  a  column  name  (``A''-
  1467.                        ``AE'')  and  _e  must  evaluate  to  a row
  1468.                        number (0-199). If  _s_e  or  _e  is  out  of
  1469.                        bounds,  or the cell has no numeric value,
  1470.                        the result is 0.  You  can  use  this  for
  1471.                        simple  table  lookups.  Be sure the table
  1472.                        doesn't  move  unexpectedly!    See   also
  1473.                        @_s_v_a_l() below.
  1474.  
  1475.   String Expressions
  1476.      String expressions are made up of constant strings  (charac-
  1477.      ters  surrounded by double quotation marks), variables (cell
  1478.      names, which refer to the cells's label strings  or  expres-
  1479.      sions),  and string functions.  Note that string expressions
  1480.      are only allowed when entering a cell's  label  string,  not
  1481.      its  numeric part.  Also note that string expression results
  1482.      may be left or right flushed or centered, according  to  the
  1483.      type of the cell's string label.
  1484.  
  1485.      #    Concatenate strings.  For example, the  string  expres-
  1486.           sion
  1487.  
  1488.                A0 # "zy dog"
  1489.  
  1490.           displays the string ``the lazy dog'' in the cell if the
  1491.           value of _A_0's string is ``the la''.
  1492.  
  1493.   Built-in String Functions
  1494.  
  1495.      @substr(se,e1,e2) Extract and return from string  expression
  1496.                        _s_e  the  substring  indexed  by  character
  1497.                        number  _e_1  through  character  number  _e_2
  1498.                        (defaults  to the size of _s_e if beyond the
  1499.                        end of it).  If  _e_1  is  less  than  1  or
  1500.                        greater  than  _e_2,  the result is the null
  1501.                        string.  For example,
  1502.  
  1503.                             @substr ("Nice jacket", 4, 7)
  1504.  
  1505.                        returns the string ``e jac''.
  1506.  
  1507.      @fmt(se,e)        Convert a number to a string.   The  argu-
  1508.                        ment  _s_e  must be a valid _p_r_i_n_t_f(3) format
  1509.                        string.  _e is converted according  to  the
  1510.                        standard  rules.  For example, the expres-
  1511.                        sion
  1512.  
  1513.  
  1514.  
  1515.                                                                23
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522. SC 6.21 (1)              USER COMMANDS                SC 6.21 (1)
  1523.  
  1524.  
  1525.  
  1526.                             @fmt ("**%6.3f**", 10.5)
  1527.  
  1528.                        yields the string ``**10.500**''.  _e is  a
  1529.                        double, so applicable formats are e, E, f,
  1530.                        g, and G.  Try ``%g'' as a starting point.
  1531.  
  1532.      @sval(se,e)       Return the string value of a cell selected
  1533.                        by name.  String expression _s_e must evalu-
  1534.                        ate to a column name (``A''-``AE'') and  _e
  1535.                        must  evaluate to a row number (0-199). If
  1536.                        _s_e or _e is out of bounds, or the cell  has
  1537.                        no  string  value,  the result is the null
  1538.                        string.  You can use this for simple table
  1539.                        lookups.   Be  sure the table doesn't move
  1540.                        unexpectedly!
  1541.  
  1542.      @upper(e)         and @lower(e) will case the string expres-
  1543.                        sion to upper or lower.
  1544.  
  1545.      @capital(e)       will convert the first letter of words  in
  1546.                        a string into upper case and other letters
  1547.                        to lower case (the latter if  all  letters
  1548.                        of the string are upper case).
  1549.  
  1550.      @upper(e)         and @lower(e) will case the string expres-
  1551.                        sion to upper or lower.
  1552.  
  1553.      @capital(e)       will convert the first letter of words  in
  1554.                        a string into upper case.
  1555.  
  1556.      @ext(se,e)        Call  an  external  function  (program  or
  1557.                        script).   The  purpose  is to allow arbi-
  1558.                        trary  functions  on  values,  e.g.  table
  1559.                        lookups    and   interpolations.    String
  1560.                        expression _s_e is a command or command line
  1561.                        to  call with _p_o_p_e_n(3).  The value of _e is
  1562.                        converted to a string and appended to  the
  1563.                        command  line  as an argument.  The result
  1564.                        of @_e_x_t() is  a  string:  the  first  line
  1565.                        printed to standard output by the command.
  1566.                        The command should emit exactly one output
  1567.                        line.   Additional  output,  or  output to
  1568.                        standard  error,  messes  up  the  screen.
  1569.                        @_e_x_t() returns a null string and prints an
  1570.                        appropriate warning if external  functions
  1571.                        are  disabled,  _s_e is null, or the attempt
  1572.                        to run the command fails.
  1573.  
  1574.                        External functions can be slow to run, and
  1575.                        if  enabled  are  called  at  each  screen
  1576.                        update, so they are disabled  by  default.
  1577.                        You  can  enable  them  with  ^_T  when you
  1578.  
  1579.  
  1580.  
  1581.                                                                24
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588. SC 6.21 (1)              USER COMMANDS                SC 6.21 (1)
  1589.  
  1590.  
  1591.  
  1592.                        really want them called.
  1593.  
  1594.                        A simple example:
  1595.  
  1596.                             @ext ("echo", a1)
  1597.  
  1598.                        You can use @_s_t_o_n() to convert the  @_e_x_t()
  1599.                        result back to a number.  For example:
  1600.  
  1601.                             @ston (@ext ("form.sc.ext", a9 + b9))
  1602.  
  1603.                        Note that you can  built  a  command  line
  1604.                        (including  more  argument  values) from a
  1605.                        string expression with concatenation.  You
  1606.                        can  also  "hide"  the  second argument by
  1607.                        ending the command line  (first  argument)
  1608.                        with `` #'' (shell comment).
  1609.  
  1610.      @coltoa(e)        Returns a string name for  a  column  from
  1611.                        the numeric argument.  For example:
  1612.  
  1613.                             @coltoa(@mycol-1)
  1614.                             @nval(coltoa(@mycol-1), @myrow+1)
  1615.  
  1616.  
  1617.  
  1618.   Built-in Financial Functions
  1619.      Financial functions compute the mortgage (or loan)  payment,
  1620.      future value, and the present value functions.  Each accepts
  1621.      three arguments, an amount, a rate of interest (per period),
  1622.      and  the number of periods.  These functions are the same as
  1623.      those commonly found in  other  spreadsheets  and  financial
  1624.      calculators
  1625.  
  1626.      @pmt(e1,e2,e3)    @_p_m_t(60000,.01,360) computes  the  monthly
  1627.                        payments  for  a  $60000  mortgage  at 12%
  1628.                        annual interest (.01  per  month)  for  30
  1629.                        years (360 months).
  1630.  
  1631.      @fv(e1,e2,e3)     @_f_v(100,.005,36) computes the future value
  1632.                        for  of  36 monthly payments of $100 at 6%
  1633.                        interest (.005 per month).  It answers the
  1634.                        question:  "How  much  will  I  have in 36
  1635.                        months if I deposit $100 per  month  in  a
  1636.                        savings  account  paying  6% interest com-
  1637.                        pounded monthly?"
  1638.  
  1639.      @pv(e1,e2,e3)     @_p_v(1000,.015,36)  computes  the   present
  1640.                        value  of  an  a  ordinary  annuity  of 36
  1641.                        monthly payments of $1000  at  18%  annual
  1642.                        interest.   It  answers the question: "How
  1643.                        much can I borrow at 18% for 30 years if I
  1644.  
  1645.  
  1646.  
  1647.                                                                25
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654. SC 6.21 (1)              USER COMMANDS                SC 6.21 (1)
  1655.  
  1656.  
  1657.  
  1658.                        pay $1000 per month?"
  1659.  
  1660.   Built-in Date and Time Functions
  1661.      Time for _s_c follows  the  system  standard:  the  number  of
  1662.      seconds  since  1970.   All  date  and time functions except
  1663.      @_d_a_t_e() return numbers, not strings.
  1664.  
  1665.      @now              Return the current  time  encoded  as  the
  1666.                        number  of  seconds since the beginning of
  1667.                        the epoch (December  31,  1969,  midnight,
  1668.                        GMT.)
  1669.  
  1670.      @dts(e1,e2,e3)    @_d_t_s(9,14,1988)  converts  the  date  Sep-
  1671.                        tember  14,  1988 to the number of seconds
  1672.                        from the epoch  to  the  first  second  of
  1673.                        9/14/88,   local   time.    For   example,
  1674.                        @_d_a_t_e(@_d_t_s(12,14,1976)) yields
  1675.  
  1676.                             _T_u_e _D_e_c _1_4 _0_0:_0_0:_0_0 _1_9_7_6
  1677.  
  1678.                        The month should be range from  1  to  12,
  1679.                        the  day should range from 1 to the number
  1680.                        of days in the specified  month,  and  the
  1681.                        year should range from 1970 to 1999.
  1682.  
  1683.      @tts(e1,e2,e3)    @_t_t_s(8,20,45) converts the time 8:40:45 to
  1684.                        the  number of seconds since midnight, the
  1685.                        night before.  The hour should range  from
  1686.                        0  to  23;  the minutes and seconds should
  1687.                        range from 0 to 59.
  1688.  
  1689.      The following functions take the time in seconds (e.g.  from
  1690.      @_n_o_w)  as  an  argument and return the specified value.  The
  1691.      functions all convert from GMT to local time.
  1692.  
  1693.      @date(e)          Convert the time  in  seconds  to  a  date
  1694.                        string 24 characters long in the following
  1695.                        form:
  1696.  
  1697.                             _S_u_n _S_e_p _1_6 _0_1:_0_3:_5_2 _1_9_7_3
  1698.  
  1699.                        Note that you can extract  parts  of  this
  1700.                        fixed-format string with @_s_u_b_s_t_r().
  1701.  
  1702.      @year(e)          Return the year.  Valid years  begin  with
  1703.                        1970.   The  last  legal  year  is  system
  1704.                        dependent.
  1705.  
  1706.      @month(e)         Return the month, encoded as  1  (January)
  1707.                        to 12 (December).
  1708.  
  1709.      @day(e)           Return the day of the month, encoded as  1
  1710.  
  1711.  
  1712.  
  1713.                                                                26
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720. SC 6.21 (1)              USER COMMANDS                SC 6.21 (1)
  1721.  
  1722.  
  1723.  
  1724.                        to 31.
  1725.  
  1726.      @hour(e)          Return the number of hours since midnight,
  1727.                        encoded as 0 to 23.
  1728.  
  1729.      @minute(e)        Return the number  of  minutes  since  the
  1730.                        last full hour, encoded as 0 to 59.
  1731.  
  1732.      @second(e)        Return the number  of  seconds  since  the
  1733.                        last full minute, encoded as 0 to 59.
  1734.  
  1735.   Spreadsheet Update
  1736.      Re-evaluation of spreadsheet expressions is done by  row  or
  1737.      by  column  depending  on  the  selected  calculation order.
  1738.      Evaluation is repeated  up  to  _i_t_e_r_a_t_i_o_n_s  times  for  each
  1739.      update  if  necessary, so forward references usually work as
  1740.      expected.  See _s_e_t above.  If stability is not reached after
  1741.      ten  iterations,  a warning is printed.  This is usually due
  1742.      to a long series  of  forward  references,  or  to  unstable
  1743.      cyclic  references  (for  example,  set  _A_0's  expression to
  1744.      ``A0+1'').
  1745.  
  1746.      @numiter          Returns the number of iterations performed
  1747.                        so far.
  1748.  
  1749. FILES
  1750.      tutorial.sc       tutorial spreadsheet
  1751.  
  1752. SEE ALSO
  1753.      bc(1), dc(1), crypt(1), psc(1)
  1754.  
  1755. BUGS
  1756.      Top-to-bottom, left-to-right evaluation  of  expressions  is
  1757.      silly.   A  proper  following  of  the dependency graph with
  1758.      (perhaps) recourse to relaxation should be implemented.
  1759.  
  1760.      Only one previous value is saved from any  call  of  @_e_x_t().
  1761.      If  it  is used more than once in a spreadsheet and external
  1762.      functions are enabled and later disabled, the last  returned
  1763.      value pops up in several places.
  1764.  
  1765.      On some systems, if the cell cursor is in column 0 with top-
  1766.      line enabled (so the current cell is highlighted), or if any
  1767.      cell in column  0  is  highlighted,  the  corresponding  row
  1768.      number  gets  displayed  and  then  blanked  during a screen
  1769.      refresh.  This looks like a bug in _c_u_r_s_e_s.
  1770.  
  1771.      Many commands give no indication (a message or beep) if they
  1772.      have  null  effect.   Some should give confirmation of their
  1773.      action, but they don't.
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.                                                                27
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786. SC 6.21 (1)              USER COMMANDS                SC 6.21 (1)
  1787.  
  1788.  
  1789.  
  1790. AUTHORS
  1791.      This is a much modified version of a  public  domain  spread
  1792.      sheet originally authored by James Gosling, and subsequently
  1793.      modified and posted to USENET by Mark Weiser under the  name
  1794.      _v_c.   The  program  was subsequently renamed _s_c, and further
  1795.      modified by numerous contributors, Jeff Buhrt  of  Proslink,
  1796.      Inc.   ({sequent,  uunet}!sawmill!prslnk!buhrt)  and  Robert
  1797.      Bond of Sequent, prominent among them.   Other  contributors
  1798.      include: Tom Anderson, Glenn T. Barry, Gregory Bond, Stephen
  1799.      (Steve) M. Brooks, Peter  Brower,  John  Campbell,  Lawrence
  1800.      Cipriani,  Jim  Clausing,  Dave  Close, Chris Cole, Jonathan
  1801.      Crompron, David I. Dalva, Glen Ditchfield, Sam Drake,  James
  1802.      P.  Dugal,  Paul  Eggert,  Andy  Fyfe, Jack Goral, Piercarlo
  1803.      "Peter" Grandi, Henk Hesselink, Jeffrey C Honig,  Kurt  Hor-
  1804.      ton,  Jonathan  I. Kamens, Peter King, Tom Kloos, Casey Lee-
  1805.      dom, Jay Lepreau, Dave Lewis, Rick Linck, Soren  Lundsgaard,
  1806.      Tad  Mannes,  Rob  McMahon,  Chris  Metcalf, Mark Nagel, Ulf
  1807.      Noren, Marius Olafsson, Gene H. Olson, Henk P. Penning, Rick
  1808.      Perry,  Larry  Philps,  Eric  Putz,  Jim Richardson, Michael
  1809.      Richardson, R. P. C. Rodgers, Kim  Sanders,  Mike  Schwartz,
  1810.      Alan   Silverstein,  Lowell  Skoog,  Herr  Soeryantono,  Tim
  1811.      Theisen, Tom  Tkacik,  Andy  Valencia,  Adri  Verhoef,  Rick
  1812.      Walker, Petri Wessman, and Tim Wilson.
  1813.  
  1814.  
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.                                                                28
  1846.  
  1847.  
  1848.  
  1849.