home *** CD-ROM | disk | FTP | other *** search
/ Between Heaven & Hell 2 / BetweenHeavenHell.cdr / 500 / 444 / analytcl.crd < prev    next >
Text File  |  1986-04-14  |  24KB  |  473 lines

  1.                                AnalytiCalc
  2.                            The Analyst's Tool
  3.                        Reference Card and Summary
  4.  
  5.  
  6.       There are 2 major command modes.  The default is described  here  but the 
  7.       "/;" command enters the other and the "//" command goes back to  the mode 
  8.       described in this reference.  
  9.  
  10.       The  second  ("/;"  mode)  command format is more like other spreadsheets 
  11.       generally.   Numbers and formulas are automatically ENTERed when typed at 
  12.       the start of  a  line.  If you start a line with ", it is entered as text 
  13.       (minus the ").   If  you  start  a  line with "/" (just the slash, not in 
  14.       quotes), the remainder of the  line  is taken as a command.  Commands are 
  15.       NOT recognized unless preceded by /  in  this  mode.    Some  of the auto 
  16.       keypad keys don't work well as defaulted  in  this  mode.   To facilitate 
  17.       writing usable command procedures, the /# command swaps  the current mode 
  18.       with a saved mode.  A command file can  use  this to save and restore the 
  19.       user's command mode and use a known mode internally.
  20.  
  21.       The sheet is displayed at the top part of the  screen  and a command cell 
  22.       in Row 23 is shown with the current position encoded.   This  starts  off 
  23.       looking like
  24.  
  25.      A  1>   ("Command-mostly" mode), or
  26.      A  1:   ("Enter-mostly" mode)
  27.  
  28.       When  in "Enter-mostly" mode, begin all commands with / so that the  exit 
  29.       command  (X)  is  given as /X in that mode.  It is a  good  idea  to  use 
  30.       AnalytiCalc  in  one mode or the other most of the time;  switching modes 
  31.       can cause confusion.
  32.  
  33.       The commands available in AnalytiCalc are each described separately.  The 
  34.       following is a brief listing alphabetically of their names.
  35.  
  36.    +J filename                Start journaling to filename  
  37.    +N                         Close journal file  
  38.    <                          Rewind input file  
  39.    %prompt%cmd%key%           Issue prompt and do cmd depending on key  
  40.    $ or }                     Perform operating system command  
  41.    > or >>pattern             Search for formula  containing  or  starting with 
  42.                 pattern  
  43.    *                          Comment line  
  44.    -prompt                    Load arguments after prompt  
  45.    //                         Use "Command-Mostly" mode  
  46.    /;                         Use "Enter-Mostly" mode  
  47.    /#                         Swap current mode with  save  mode (cmd-mostly or 
  48.                 ent-mostly)  
  49.    1,2,3, or 4                Move cursor Up, Down, Left, or Right  
  50.    @file.typ                  Read file.typ as input instead of console  
  51.    AA nn {R/C}                Add absolute nn rows or columns  
  52.    AR nn {R/C}                Add relocating nn rows or columns (nn may be neg)  
  53.    CA in-range out-range      Copy All (Absolute)  
  54.    CV in-range out-range      Copy Value  
  55.    CF in-range out-range      Copy Formula (and Format)  
  56.    CR in-range out-range      Copy Relocating (all)  
  57.    DB ncol,nrow               Display Bounds (no. cols,rows on screen)  
  58.    DF range [format]          Display Format of range to format  
  59.    DL range {R/C}n:m          Display  Locate  range  as  Row/Col   to  display 
  60.                 col:row n:m  
  61.    DS{R/C}{A/D} n             Display Sort row/col, Asc/Desc row/col n  
  62.    DT range {F/I}             Display Type range as Float or Integer  
  63.    DW ncol,wid                Display Width of col "ncol" to "wid" chars  
  64.    E expression               Enter expression into cell  
  65.    E" expression              Enter expression as text, no case translation  
  66.    ED 'oldstring'newstring'   EDit cell  
  67.    ET expression              Enter expression as UPPER CASE text  
  68.    EV expression              Enter expression as computable formula  
  69.    F filename/nskip           File read from filename onto display  
  70.    G                          Get saved sheet.  Many variants.   
  71.    Hn                         HELP and show page n  
  72.    IR inrange outrange        In Place Relocate inrange as if moved to outrange  
  73.    K                          Go into interactive calculator (need *V  3).   *E 
  74.                 goes back.   
  75.    L cell                     Go to cell  
  76.    M{0/1/2/3/4/5}             Move - set move direction after enter  
  77.    MS or MH                   Macrocell  Show or Hide - show or  hide  included 
  78.                 files.   
  79.    OA cell                    Origin  Absolute  cell - Map Screen with cell  in 
  80.                 upper left  
  81.    OAD cell                   Origin  Absolute  Displace cell - Map Screen with 
  82.                 cell in upper left leaving old windowing alone  
  83.    OR cell                    Origin Relative  cell  -  map  screen dwn/rght of 
  84.                 cursor w/curs=cell  
  85.    ORD cell                   Origin  Relative  Displace   cell  -  map  screen 
  86.                 down/right of cursor with  cursor=cell  leaving 
  87.                 old windows  
  88.    OV +                       OVerride absolute refs, make relative  
  89.    OV -                       OVerride off - let abs refs be absolute  
  90.    P                          Put (save) spreadsheet.  Many variations.   
  91.    R                          Recalculate sheet  
  92.    RB cell                    Set Relocate Boundary at cell  
  93.    RE                         Recalculate   Entry  -  recalculate  only    cell 
  94.                 entered.   
  95.    RF                         Recalculate, Force recalc of constants  
  96.    RI                         Recalculate  Incremental  - Recalculate only cell 
  97.                 entered and displayed cells.   
  98.    RII                        Set  Recalc  Incremental  flag but don't actually 
  99.                 recalculate.   
  100.    RM                         Recalculate Manual - no recalc until R cmd  
  101.    S                          Setup - Global mapping/width/title setups  
  102.    TE expression              TEst  -  Evaluate  math expression in cmd mode  - 
  103.                 many variants.   
  104.    V                          View - Redraw screen  
  105.    VF                         View  Formulas  -  Draw  with Formulas instead of 
  106.                 numbers  
  107.    VM                         View Manual - no screen repaint until a V cmd  
  108.    W                          Write display to file or printer.   
  109.    X                          eXit from AnalytiCalc.  Asks for confirmation.   
  110.    ZE range                   ZEro range of cells  
  111.    ZA                         Zero All  of sheet.  Asks for confirmation.  Also 
  112.                 used for reinitializing.   
  113.  
  114.                                     AnalytiCalc Function Summary
  115.  
  116.       The available multiple argument functions are:  
  117.     SUM[variables]     Sum of all arguments 
  118.     MAX[variables]     Max of arguments 
  119.     MIN[variables]     Min of arguments 
  120.     AVG[variables]     Average of arguments 
  121.     AVE[variables]     Average of arguments excluding zero args 
  122.     STD[variables]     Standard deviation squared 
  123.     AND[variables]     Boolean AND of all variables in list 
  124.     IOR[variables]     Boolean inclusive OR of variables 
  125.     NOT[variable]      Boolean complement of variable 
  126.     XOR[v1,v2]         Boolean exclusive OR of v1,v2 
  127.     EQV[V1,V2]         Boolean "equivalence" of V1,V2 
  128.                        (complement of exclusive OR, true if 
  129.                        bits have the SAME value) 
  130.     CNT[variables]     Number of nonzero variables in list 
  131.     MOD[V1,V2]         Returns V1 modulo V2 (i.e., remainder 
  132.                        of V1/V2 division.) 
  133.     SGN[v1]            Returns 1.0 times sign of V1 
  134.     LKP[var,variables] Lookup variable in "variables" range 
  135.                        greater or equal to var, return its 
  136.                        index (starting with 0) into variables 
  137.                        range. 
  138.     LKN[var,variables] Lookup variable in "variables" range 
  139.                        less than or equal to var, return its 
  140.                        index (starting with 0) into variables 
  141.                        range. 
  142.     LKE[var,variables] Lookup variable in "variables" range 
  143.                        strictly equal to var, return its index 
  144.                        (starting with 0) into range. Note all 
  145.                        LKP, LKN, LKE return the last variable 
  146.                        index if no satisfactory value found. 
  147.     NPV[disc,vars]     Net Present Value of vars (equal time 
  148.                        interval numbers), at discount rate 
  149.                        disc where disc is a fraction 
  150.                        (e.g., .12 for 12%) 
  151.     IRR[PV,FV,returns] Internal Rate of Return. Will compute 
  152.                        internal rate of return on up to 20 
  153.                        periods, returning rate per period. 
  154.                        The returns are expected to be at 
  155.                        equal time intervals. PV and FV are 
  156.                        initial and final values of investment 
  157.                        and the result is computed via Newton 
  158.                        approximation. 
  159.      PMT[princ,inter,nper] Payment (mortgage payment per period) 
  160.                        function. Will compute payment per period 
  161.                        for principal amount "princ" with interest 
  162.                        per period as "inter" and number of periods 
  163.                        as "nper". All arguments must be cells. 
  164.                        The formula is the standard ordinary annuity 
  165.                        formula. Interest rate must be a fraction so 
  166.                        that 14% would be 0.14, for example. 
  167.      PVL[payment,inter,nper] Present Value formula. Computes present 
  168.                        value of an annuity given "payment", the payment 
  169.                        per period, interest rate per period (as a 
  170.                        fraction, so 12% is 0.12) in "inter", and 
  171.                        number of periods as "nper". All arguments 
  172.                        must be in cells. 
  173.      RND[DUM]          Generates a random number between 0. and 
  174.                        1.0. An argument is needed but it is 
  175.                        NOT touched by this function. 
  176.      CHS[V1,cells]     Choose value from list of cells based on value
  177.                        of V1 cell. If V1 is 1, first cell in range is
  178.                        chosen. If V1=2, second cell is chosen and so
  179.                        on. If V1 is out of range zero is returned. Also
  180.                        sets ACs to have row, col of chosen cell like
  181.                        MIN, MAX, and LKx functions.
  182.  
  183.      IF [V1.rel.V2] statement | else-statement 
  184.       Compares two variables and executes either "statement" (if the 
  185.        relation is true) or "else-statement" (if the relation is 
  186.        false). 
  187.       Valid relations (in the place of the .rel. above) are: 
  188.         .EQ.    Equal 
  189.         .NE.    Not Equal 
  190.         .GT.    Greater than (V1 greater than V2) 
  191.         .LT.    Less than (V1 less than V2) 
  192.         .GE.    Greater than or Equal to (V1 >= V2) 
  193.         .LE.    Less than or Equal to (V1 =< V2) 
  194.  
  195. The following single argument functions are available:  
  196.  
  197.    FUNCT NAME   ARG TYPE    FUNCT VALUE   DESCRIPTION 
  198.    ------------------------------------------------------- 
  199.    ABS          REAL        REAL         absolute value 
  200.    DABS         REAL        REAL         absolute value 
  201.    IABS         INTEGER     INTEGER      absolute value 
  202.    IFIX         REAL        INTEGER      REAL to INT conv. 
  203.    AINT         REAL        REAL         REAL truncation 
  204.    INT          REAL        INTEGER      REAL to INT conv. 
  205.    IDINT        REAL        INTEGER      REAL to INT conv. 
  206.    EXP          REAL        REAL         e**X 
  207.    DEXP         REAL        REAL         e**X 
  208.    ALOG         REAL        REAL         natural logarithm 
  209.    DLOG         REAL        REAL         natural logarithm 
  210.    ALOG10       REAL        REAL         logarithm base 10 
  211.    DLOG10       REAL        REAL         logarithm base 10 
  212.    SQRT         REAL        REAL         square root 
  213.    DSQRT        REAL        REAL         square root 
  214.    SIN          REAL        REAL         trigonometric sine 
  215.    DSIN         REAL        REAL         trigonometric sine 
  216.    COS          REAL        REAL         trig. cosine 
  217.    DCOS         REAL        REAL         trig. cosine 
  218.    TANH         REAL        REAL         hyperbolic tangent 
  219.    DTANH        REAL        REAL         hyperbolic tangent 
  220.    ATAN         REAL        REAL         arc tangent 
  221.    DATAN        REAL        REAL         arc tangent 
  222.  
  223.       The following special constructs in a formula act as functions:  
  224.        _@V1,V2 Means get the values  stored in V1 and V2 and use them as column 
  225.     and row locations pointing at some  cell  in  the  sheet.   Replace the 
  226.     construct with the name of that cell.  
  227.  
  228.        _#V1 Means take the real number in  cell  V1  and unpack it as if it had 
  229.     been a packed value from a formula with  8  characters  packed;    then 
  230.     convert it back into ASCII and place in the  formula  in  place of this 
  231.     construct.   This construct is intended to be used with  the  *U  STRVL 
  232.     function  to  allow  retrieval  and  edit  of  formulas.  The *U  XQTCM 
  233.     function  permits  use  of  the  EDit  command within a cell for string 
  234.     manipulation.  
  235.  
  236.       The following  "equation commands" also act as functions with the effects 
  237.     described:  
  238.  
  239.   *@filename   Where filename is  the  name  of  a file of CALC commands.  CALC 
  240.              reads the file and executes the commands.  
  241.  
  242.   *ASCII       Declares a list of variables to be of type ASCII.  
  243.   *C           COMMENT line.  
  244.   *N           NOVIEW.  
  245.   *V           VIEW.  Controls printing options in K mode 
  246.   *R           READ.  Allows a single line to be read from the terminal.  
  247.   *REAL        Declares specified variables to be REAL*8.  
  248.   *DECIMAL     Declares specified variables to be REAL*8.  
  249.   *S           STOP.  Same as *E.  Goes back to spreadsheet.  
  250.   *E           EXIT.  Gets out of K mode, back to spreadsheet mode.  
  251.   *Z           ZERO.  Zeroes all accumulators.  
  252.   *G        *G V1,V2 (where V1  and  V2  are  cell  or  accumulator names) will 
  253.              evaluate V1 and V2 as  the  column and row numbers, on the 
  254.              physical sheet, of the desired cell.  The addressed cell's 
  255.              value is retrieved and used as the resulting number.  
  256.  
  257.   *W        Takes  the value at the current cell  and  writes  it  out  to  the 
  258.              formula as a numeric (float- ing) value.   The *WF command 
  259.              stores  the  cell  similarly,  but uses the format of  the 
  260.              current cell instead of the D32.25 format used for *W.  
  261.  
  262.   *P        The  *P  command  resets the current cell coordinate from within  a 
  263.              cell  (until  the  next  cell  is evaluated only).  It has 
  264.              several forms:  
  265.  
  266.              *P -  By  itself,  *P  causes  Calc to prompt for the new physical 
  267.              column and row number.  
  268.  
  269.              *P V1 - This moves the current location to the named cell where V1 
  270.              is the cell name (e.g.  A5, H2) 
  271.  
  272.              *P@ V1,V2 - This  uses  V1  and  V2 (cell names) as column and row 
  273.              numbers and changes the current  physical cell position to 
  274.              that defined by the contents of  cells  V1  and  V2.  This 
  275.              gives  complete  addressing of the sheet from  within  any 
  276.              cell.  
  277.  
  278.   *F        *F Label - If the value in %  is  positive and nonzero this command 
  279.              rewinds  the input file for the AnalytiCalc @ command  and 
  280.              seeks  a line beginning with the characters *CLabel (where 
  281.              "label" is what you put after the *F command).  
  282.  
  283.   *J        *J Label  -  This command behaves as the *F command but operates on 
  284.              the file used  by  the  Calc  *@  command  rather than the 
  285.              AnalytiCalc one.  
  286.  
  287.   *QF 
  288.   *QW       The  *QF (Float) or  *QW  (write)  commands  are  used  to  examine 
  289.              sequential  files created outside AnalytiCalc  and  return 
  290.              values or formulas.  Their syntax is 
  291.  
  292.            *QF filename ?key1? ?key2? <lm> 
  293.         or *QW filename ?key1? ?key2? <lm> 
  294.                where ?key2? is optional 
  295.                l and m are delimiter characters  for start and end of the parts 
  296.              of the selected records to extract (defaults to first part 
  297.              of the record) filename is just the file  specifier in the 
  298.              host  OS.    The  *QF  command  gets a part  of  a  record 
  299.              containing  the  keys specified and turns it into a number 
  300.              ("floats"  it).    The *QW command Writes that part of the 
  301.              record to  a  formula.  The special characters in the <lm> 
  302.              part of the  com-  mand  are  delimiters of the area to be 
  303.              picked out.  Variant  forms  allow  such choosing to be by 
  304.              column number instead of key character if needed.  
  305.  
  306.   *U YRMOD VY,VM,VD 
  307.                returns the Julian date (in  %)  computed from the Year (in VY), 
  308.              the month (in VM) and the  day  (in VD), where VY, VM, and 
  309.              VD  are sheet cells.  These may  be  the  result  of  date 
  310.              arithmetic.  
  311.  
  312.   *U JDATE Var 
  313.                assumes  the  formula  in cell Var (any spreadsheet  cell  name) 
  314.              contains a date string in the format YY/MM/DD.   It  reads 
  315.              this  formula  and  converts  the  date  to a Julian date, 
  316.              returning it in the % accumulator.  
  317.  
  318.   *U JTOCH Jul,Var 
  319.                assumes that  variable  Jul  (any  spreadsheet  cell) contains a 
  320.              Julian date and  changes  it  into  an ASCII string in the 
  321.              cell whose name is in the Var position here.  
  322.  
  323.   *U DATE VY,VM,VD,Var 
  324.                uses VY, VM, and  VD  as  year,  month  and  day, and computes a 
  325.              Julian date from them.   It  then composes an ASCII string 
  326.              of form YY/MM/DD for that date and stores in the for- mula 
  327.              for Var.  
  328.  
  329.   *U WKDYS D1,D2 
  330.                computes the number of workdays between Julian  dates  D1 and D2 
  331.              just  as taking the difference of two Julian  dates  gives 
  332.              differences between calendar dates in days.  
  333.  
  334.   *U WKDIN D1,N1 
  335.                returns a Julian date that is N1 work days after the date in D1.  
  336.  
  337.   *U IDATE() 
  338.                returns the current date as a Julian day.  
  339.  
  340.   *U MTXEQ(AA:AA,XX:XX,BB:BB) 
  341.                solves equation AX=B where A, X, and B are  matrices,  and where 
  342.              the  notation AA:AA means two cells at the upper left  and 
  343.              lower right edges of matrix A (e.g.  B2:C3 for the  2  X 2 
  344.              matrix so defined), and the XX:XX and BB:BB notation means 
  345.              the same for the X and B matrices.  
  346.  
  347.   *U MOVEV mtxa,mtxb 
  348.                moves values from mtxa to mtxb (useful prior to calling MTXEQ).  
  349.  
  350.   *U MDET mtx 
  351.                This function computes  and  returns  the  determinant of matrix 
  352.              mtx.  
  353.  
  354.   *U MPROD A,B,C 
  355.                This function will multiply  matrix  A by matrix B giving matrix 
  356.              C, provided that their dimensions are compatible.  
  357.  
  358.   *U MADDV A,B,C 
  359.                This function adds matrix A  to matrix B and stores in matrix C.  
  360.              All matrices must have the same dimensions.  
  361.  
  362.   *U MSUBV A,B,C 
  363.                This  function  subtracts matrix B from  matrix  A  leaving  the 
  364.              result in matrix C.  
  365.  
  366.   *U MMPYT A,B,C 
  367.                This  function  multiplies  matrix  A-transpose  by matrix B and 
  368.              stores  the  result  in  matrix  C;    dimensions  must be 
  369.              compatible.  
  370.  
  371.   *U MMPYC A,B,K 
  372.                This function  multiplies  every element of matrix A by constant 
  373.              K.  
  374.  
  375.   *U VARY X,A,W,I,P;Q;R;S;T;U;V;W 
  376.                (Equation Solving by Iterative Search) 
  377.                This function allows  AnalytiCalc  to  automatically  search for 
  378.              solutions to equations over  up  to  8  dimensions.    The 
  379.              operation is that the accumulators  named  in  the  fields 
  380.              shown as P;Q;R;S;T;U;V;W (one to 8  may be specified, only 
  381.              one is required) are varied by a  fraction  W  about their 
  382.              initial values (later scaled down by the gradient  of  the 
  383.              change in X) to attempt to get accumulator or  cell  X  to 
  384.              equal  accumulator  or  cell  A.    This  is  done  for  I 
  385.              iterations, where I is another accumulator.  
  386.  
  387.   *U XQTCM command will execute the  command  (terminated  by the end-of-line), 
  388.              with any command except  X  or  K permitted, from inside a 
  389.              cell.  This allows command  files  driven  from  cells  to 
  390.              control moving data, etc.  
  391.  
  392.   *U STRVL V1,start;len 
  393.                  will return a value that is made from  up  to  8 characters in 
  394.              the  FORMULA  of  cell  V1  (where V1 is any  cell  name), 
  395.              starting at character "start" and for "len" characters. 
  396.  
  397.   *U HERE 
  398.                  will return the current location on the matrix and the current 
  399.              maximum row and column used. T, U get cell coords.
  400.  
  401.   *U  FFTFW and *U FFTRV perform Fast Fourier Transforms  in  the  forward  and 
  402.              reverse (inverse) directions on the given range of data.  
  403.  
  404.   *U LINEF Vy:Vy,Vx:Vx (with the Vx range optional) fits a line to the input range.  
  405.                      y=Ux+T, err in %, corr. coeff. in W.
  406.  
  407.   *XV filename V1 
  408.   *XF filename V1        The *X class commands are for sheet linkages.  
  409.                *XF loads a Formula from  another  saved  spreadsheet, while *XV 
  410.              loads a Value.  
  411.  
  412.       The  following  *U DBxxxxxx functions also  exist  as  commands  of  form 
  413.              FILxxxxxx with the same results.  
  414.  
  415.   *U DBOPINS range filename - Open  input  sequential on filename for cells  in 
  416.              range.  (Reads of input range formulas come from file when 
  417.              enabled.)
  418.  
  419.   *U DBOPINR range filename Open input random on filename for cells in range 
  420.  
  421.   *U DBOPINU  range filename Open  range  for  update  on filename for read and 
  422.              write as random access.
  423.  
  424.   *U DBCLSINP Close input 
  425.  
  426.   *U DBCLSOUT Close output 
  427.  
  428.   *U DBOPOUTS range filename Open  output  sequential    from  range  cells  to 
  429.              filename.  (Writes of  formulas  in  output  range  go  to 
  430.              file.)
  431.  
  432.   *U DBOPOUTR range filename Open output random from range on filename 
  433.  
  434.   *U DBENAINP Enable input file readin (initially disabled) 
  435.  
  436.   *U DBENAOUT Enable output write (initially disabled) 
  437.  
  438.   *U DBDISINP Disable input area readin 
  439.  
  440.   *U DBDISOUT Disable output write 
  441.  
  442.   *U DBEDTINP range Enables input and output and,  for  each  cell in the given 
  443.              range,  reads  and  writes  the cell,  allowing  the  file 
  444.              read/writes to take effect.  Each cell is flagged as valid 
  445.              but of text type;  the DF command  must  be  used to reset 
  446.              any  that  should  be  treated  as computable.  Input  and 
  447.              output are disabled on completion of the command.  
  448.  
  449.   *U DBFMTOUT range 
  450.   *U  DBVALOUT  range Enables  input and output and for each cell of the  range 
  451.              takes  the  VALUE of the cell, reads the cell, sets it  of 
  452.              text  type, and writes the text equivalent of its value to 
  453.              the cell.
  454.  
  455.   *U  DBCMPFRM  V1:V2[,V3:V4] Compares two  formulas.    It  returns,  in the % 
  456.              accumulator, the index  of  the  formula in cell V2 in the 
  457.              formula in cell V1.    Lengths  used  are  those  of  both 
  458.              formulas UNLESS the V3 and  V4  cell  arguments  are seen.  
  459.              Then V3 and V4 are lengths  of  V1  and  V2  strings used.  
  460.              Accum.  W is set to comparison of V1 and V2 (-1/0/+1)
  461.  
  462.   *U  DBLENFRM  V1:V2 returns the length of the formula for  cell  V1  in the % 
  463.              accumulator and in cell V2 IF CELL V2 IS VALID.  Otherwise 
  464.              the  cell  specified in V2 is ignored, though it  must  be 
  465.              present in the command or function.  
  466.  
  467.   *U  DBTRMFRM  V1:V2,V3,V4 Reads the formula in V1 and uses V3 and V4 as start 
  468.              and  end  byte  numbers  within it.  It returns to V2  the 
  469.              formula that  is between the start and end bytes, trimming 
  470.              the V1 formula  into  V2  by  chopping  out  the undesired 
  471.              parts.
  472.  
  473.