[?27h AnalytiCalc The Analyst's Tool Reference Card and Summary [80;80 B  There are 2 major command modes. The default is described here but the "/;" command enters the other and the "//" command goes back to the mode described in this reference. The second ("/;" mode) command format is more like other spreadsheets generally. Numbers and formulas are automatically ENTERed when typed at the start of a line. If you start a line with ", it is entered as text (minus the "). If you start a line with "/" (just the slash, not in quotes), the remainder of the line is taken as a command. Commands are NOT recognized unless preceded by / in this mode. Some of the auto keypad keys don't work well as defaulted in this mode. To facili- tate writing usable command procedures, the /# command swaps the current mode with a saved mode. A command file can use this to save and restore the user's command mode and use a known mode inter- nally. The sheet is displayed at the top part of the screen and a command cell in Row 23 is shown with the current position encoded. This starts off looking like  A 1> ("Command-mostly" mode), or  A 1: ("Enter-mostly" mode) When in "Enter-mostly" mode, begin all commands with / so that the exit command (X) is given as /X in that mode. It is a good idea to use AnalytiCalc in one mode or the other most of the time; switching modes can cause confusion. [?27h COMMANDS The commands available in AnalytiCalc are each described separately. The following is a brief listing alphabetically of their names. [?27l +J filename [?27hStart journaling to filename [?27l +N [?27hClose journal file [?27l < [?27hRewind input file [?27l %prompt%cmd%key% [?27hIssue prompt and do cmd depending on key [?27l $ or } [?27hPerform operating system command [?27l > or >>pattern [?27hSearch for formula containing or starting with pattern [?27l * [?27hComment line [?27l -prompt [?27hLoad arguments after prompt [?27l // [?27hUse "Command-Mostly" mode [?27l /; [?27hUse "Enter-Mostly" mode [?27l /# [?27hSwap current mode with save mode (cmd-mostly or ent-mostly) [?27l 1,2,3, or 4 [?27hMove cursor Up, Down, Left, or Right [?27l @file.typ [?27hRead file.typ as input instead of console [?27l AA nn {R/C} [?27hAdd absolute nn rows or columns [?27l AR nn {R/C} [?27hAdd relocating nn rows or columns (nn may be neg) [?27l CA in-range out-range [?27hCopy All (Absolute) [?27l CV in-range out-range [?27hCopy Value [?27l CF in-range out-range [?27hCopy Formula (and Format) [?27l CR in-range out-range [?27hCopy Relocating (all) [?27l DB ncol,nrow [?27hDisplay Bounds (no. cols,rows on screen) [?27l DF range [format] [?27hDisplay Format of range to format [?27l DL range {R/C}n:m [?27hDisplay Locate range as Row/Col to display col:row n:m [?27l DS{R/C}{A/D} n [?27hDisplay Sort row/col, Asc/Desc row/col n [?27l DT range {F/I} [?27hDisplay Type range as Float or Integer [?27l DW ncol,wid [?27hDisplay Width of col "ncol" to "wid" chars [?27l E expression [?27hEnter expression into cell [?27l E" expression [?27hEnter expression as text, no case translation [?27l ED 'oldstring'newstring' [?27hEDit cell [?27l ET expression [?27hEnter expression as UPPER CASE text [?27l EV expression [?27hEnter expression as computable formula [?27l F filename/nskip [?27hFile read from filename onto display [?27l G [?27hGet saved sheet. Many variants. [?27l Hn [?27hHELP and show page n [?27l IR inrange outrange [?27hIn Place Relocate inrange as if moved to outrange [?27l K [?27hGo into interactive calculator (need *V 3). *E goes back. [?27l L cell [?27hGo to cell [?27l M{0/1/2/3/4/5} [?27hMove - set move direction after enter [?27l MS or MH [?27hMacrocell Show or Hide - show or hide included files. [?27l OA cell [?27hOrigin Absolute cell - Map Screen with cell in upper left [?27l OAD cell [?27hOrigin Absolute Displace cell - Map Screen with cell in[?27l [?27hupper left leaving old windowing alone [?27l OR cell [?27hOrigin Relative cell - map screen dwn/rght of cursor w/curs=cell [?27l ORD cell [?27hOrigin Relative Displace cell - map screen down/right[?27l [?27hof cursor with cursor=cell leaving old windows [?27l OV + [?27hOVerride absolute refs, make relative [?27l OV - [?27hOVerride off - let abs refs be absolute [?27l P [?27hPut (save) spreadsheet. Many variations. [?27l R [?27hRecalculate sheet [?27l RB cell [?27hSet Relocate Boundary at cell [?27l RE [?27hRecalculate Entry - recalculate only cell entered. [?27l RF [?27hRecalculate, Force recalc of constants [?27l RI [?27hRecalculate Incremental - Recalculate only cell entered and[?27l [?27hdisplayed cells. [?27l RII [?27hSet Recalc Incremental flag but don't actually recalculate. [?27l RM [?27hRecalculate Manual - no recalc until R cmd [?27l S [?27hSetup - Global mapping/width/title setups [?27l TE expression [?27hTEst - Evaluate math expression in cmd mode - many variants. [?27l V [?27hView - Redraw screen [?27l VF [?27hView Formulas - Draw with Formulas instead of numbers [?27l VM [?27hView Manual - no screen repaint until a V cmd [?27l W [?27hWrite display to file or printer. [?27l X [?27heXit from AnalytiCalc. Asks for confirmation. [?27l ZE range [?27hZEro range of cells [?27l ZA [?27hZero All of sheet. Asks for confirmation. Also used for[?27l [?27hreinitializing. [?27l [?27h AnalytiCalc Function Summary The available multiple argument functions are: [?27l  SUM[variables] [?27hSum of all arguments[?27l  MAX[variables] [?27hMax of arguments[?27l  MIN[variables] [?27hMin of arguments[?27l  AVG[variables] [?27hAverage of arguments[?27l  AVE[variables] [?27hAverage of arguments excluding zero args[?27l  STD[variables] [?27hStandard deviation squared[?27l  AND[variables] [?27hBoolean AND of all variables in list[?27l  IOR[variables] [?27hBoolean inclusive OR of variables[?27l  NOT[variable] [?27hBoolean complement of variable[?27l  XOR[v1,v2] [?27hBoolean exclusive OR of v1,v2[?27l  EQV[V1,V2] [?27hBoolean "equivalence" of V1,V2[?27l  ([?27hcomplement of exclusive OR, true if[?27l  [?27hbits have the SAME value)[?27l  CNT[variables] [?27hNumber of nonzero variables in list[?27l  MOD[V1,V2] [?27hReturns V1 modulo V2 (i.e., remainder[?27l  [?27hof V1/V2 division.)[?27l  SGN[v1] [?27hReturns 1.0 times sign of V1[?27l  LKP[var,variables] [?27hLookup variable in "variables" range[?27l  [?27hgreater or equal to var, return its[?27l  [?27hindex (starting with 0) into variables[?27l  [?27hrange.[?27l  LKN[var,variables] [?27hLookup variable in "variables" range[?27l  [?27hless than or equal to var, return its[?27l  [?27hindex (starting with 0) into variables[?27l  [?27hrange.[?27l  LKE[var,variables] [?27hLookup variable in "variables" range[?27l  [?27hstrictly equal to var, return its index[?27l  ([?27hstarting with 0) into range. Note all[?27l  [?27hLKP, LKN, LKE return the last variable[?27l  [?27hindex if no satisfactory value found.[?27l  NPV[disc,vars] [?27hNet Present Value of vars (equal time[?27l  [?27hinterval numbers), at discount rate[?27l  [?27hdisc where disc is a fraction[?27l  ([?27he.g., .12 for 12%)[?27l  IRR[PV,FV,returns] [?27hInternal Rate of Return. Will compute[?27l  [?27hinternal rate of return on up to 20[?27l  [?27hperiods, returning rate per period.[?27l  [?27hThe returns are expected to be at[?27l  [?27hequal time intervals. PV and FV are[?27l  [?27hinitial and final values of investment[?27l  [?27hand the result is computed via Newton[?27l  [?27happroximation.[?27l  PMT[princ,inter,nper] [?27hPayment (mortgage payment per period)[?27l  [?27hfunction. Will compute payment per period[?27l  [?27hfor principal amount "princ" with interest[?27l  [?27hper period as "inter" and number of periods[?27l  [?27has "nper". All arguments must be cells.[?27l  [?27hThe formula is the standard ordinary annuity[?27l  [?27hformula. Interest rate must be a fraction so[?27l  [?27hthat 14% would be 0.14, for example.[?27l  PVL[payment,inter,nper] [?27hPresent Value formula. Computes present[?27l  [?27hvalue of an annuity given "payment", the payment[?27l  [?27hper period, interest rate per period (as a[?27l  [?27hfraction, so 12% is 0.12) in "inter", and[?27l  [?27hnumber of periods as "nper". All arguments[?27l  [?27hmust be in cells.[?27l [?27hRND[DUM] Generates a random number between 0. and[?27l  1.0. [?27hAn argument is needed but it is[?27l [?27hNOT touched by this function.[?27l CHS[IDX,Range] [?27hChoose cell from range based on value of cell[?27l [?27hIDX. If cell used as IDX is 1, first element[?27l [?27hof range is chosen and so on. Zero is returned[?27l [?27hfor out of range cases.[?27l  [?27hIF [V1.rel.V2] statement | else-statement[?27l  [?27hCompares two variables and executes either "statement" (if the[?27l  [?27hrelation is true) or "else-statement" (if the relation is[?27l  [?27hfalse).[?27l  [?27hValid relations (in the place of the .rel. above) are:[?27l  .EQ. [?27hEqual[?27l  .NE. [?27hNot Equal[?27l  .GT. [?27hGreater than (V1 greater than V2)[?27l  .LT. [?27hLess than (V1 less than V2)[?27l  .GE. [?27hGreater than or Equal to (V1 >= V2)[?27l  .LE. [?27hLess than or Equal to (V1 =< V2)[?27l [?27h Functions which choose one of a list of arguments return col, row of chosen cell in accumulators P, Q. These include MIN, MAX, LKP, LKN, LKE, and CHS.[?27l The following single argument functions are available:  FUNCT NAME ARG TYPE FUNCT VALUE DESCRIPTION  -------------------------------------------------------  ABS REAL REAL [?27habsolute value[?27l  DABS REAL REAL [?27habsolute value[?27l  IABS INTEGER INTEGER [?27habsolute value[?27l  IFIX REAL INTEGER [?27hREAL to INT conv.[?27l  AINT REAL REAL [?27hREAL truncation[?27l  INT REAL INTEGER [?27hREAL to INT conv.[?27l  IDINT REAL INTEGER [?27hREAL to INT conv.[?27l  EXP REAL REAL [?27he**X[?27l  DEXP REAL REAL [?27he**X[?27l  ALOG REAL REAL [?27hnatural logarithm[?27l  DLOG REAL REAL [?27hnatural logarithm[?27l  ALOG10 REAL REAL [?27hlogarithm base 10[?27l  DLOG10 REAL REAL [?27hlogarithm base 10[?27l  SQRT REAL REAL [?27hsquare root[?27l  DSQRT REAL REAL [?27hsquare root[?27l  SIN REAL REAL [?27htrigonometric sine[?27l  DSIN REAL REAL [?27htrigonometric sine[?27l  COS REAL REAL [?27htrig. cosine[?27l  DCOS REAL REAL [?27htrig. cosine[?27l  TANH REAL REAL [?27hhyperbolic tangent[?27l  DTANH REAL REAL [?27hhyperbolic tangent[?27l  ATAN REAL REAL [?27harc tangent[?27l  DATAN REAL REAL [?27harc tangent[?27l [?27h The following special constructs in a formula act as functions: _@V1,V2 Means get the values stored in V1 and V2 and use them as column and row locations pointing at some cell in the sheet. Replace the construct with the name of that cell. _#V1 Means take the real number in cell V1 and unpack it as if it had been a packed value from a formula with 8 characters packed; then convert it back into ASCII and place in the formula in place of this construct. This construct is intended to be used with the *U STRVL function to allow retrieval and edit of formulas. The *U XQTCM function permits use of the EDit command within a cell for string manipulation. The following "equation commands" also act as functions with the effects described: *@filename Where filename is the name of a file of CALC commands. CALC reads the file and executes the commands. *ASCII Declares a list of variables to be of type ASCII. *C COMMENT line. *N NOVIEW. *V VIEW. Controls printing options in K mode *R READ. Allows a single line to be read from the terminal. *REAL declares specified variables to be REAL*8. *DECIMAL Declares specified variables to be REAL*8. *S STOP. Same as *E. Goes back to spreadsheet. *E EXIT. Gets out of K mode, back to spreadsheet mode. *Z ZERO. Zeroes all accumulators. *G *G V1,V2 (where V1 and V2 are cell or accumulator names) will evaluate V1 and V2 as the column and row numbers, on the physical sheet, of the desired cell. The addressed cell's value is retrieved and used as the resulting number. *W Takes the value at the current cell and writes it out to the formula as a numeric (float- ing) value. The *WF command stores the cell similarly, but uses the format of the current cell instead of the D32.25 format used for *W. *P The *P command resets the current cell coordinate from within a cell (until the next cell is evaluated only). It has several forms: *P - By itself, *P causes Calc to prompt for the new physical column and row number. *P V1 - This moves the current location to the named cell where V1 is the cell name (e.g. A5, H2) *P@ V1,V2 - This uses V1 and V2 (cell names) as column and row numbers and changes the current physical cell position to that defined by the contents of cells V1 and V2. This gives complete addressing of the sheet from within any cell. *F *F Label - If the value in % is positive and nonzero this command rewinds the input file for the AnalytiCalc @ command and seeks a line beginning with the characters *CLabel (where "label" is what you put after the *F command). *J *J Label - This command behaves as the *F command but operates on the file used by the Calc *@ command rather than the AnalytiCalc one. *QF *QW The *QF (Float) or *QW (write) commands are used to examine sequential files created outside AnalytiCalc and return values or formulas. Their syntax is *QF filename ?key1? ?key2? or *QW filename ?key1? ?key2? where ?key2? is optional l and m are delimiter characters for start and end of the parts of the selected records to extract (defaults to first part of the record) filename is just the file specifier in the host OS. The *QF command gets a part of a record containing the keys specified and turns it into a number ("floats" it). The *QW command Writes that part of the record to a formula. The special characters in the part of the com- mand are delimiters of the area to be picked out. Variant forms allow such choosing to be by column number instead of key character if needed. *U YRMOD VY,VM,VD returns the Julian date (in %) computed from the Year (in VY), the month (in VM) and the day (in VD), where VY, VM, and VD are sheet cells. These may be the result of date arithmetic. *U JDATE Var assumes the formula in cell Var (any spreadsheet cell name) contains a date string in the format YY/MM/DD. It reads this formula and converts the date to a Julian date, returning it in the % accumulator. *U JTOCH Jul,Var assumes that variable Jul (any spreadsheet cell) contains a Julian date and changes it into an ASCII string in the cell whose name is in the Var position here. *U DATE VY,VM,VD,Var uses VY, VM, and VD as year, month and day, and computes a Julian date from them. It then composes an ASCII string of form YY/MM/DD for that date and stores in the for- mula for Var. *U WKDYS D1,D2 computes the number of workdays between Julian dates D1 and D2 just as taking the difference of two Julian dates gives differences between calendar dates in days. *U WKDIN D1,N1 returns a Julian date that is N1 work days after the date in D1. *U IDATE() returns the current date as a Julian day. *U MTXEQ(AA:AA,XX:XX,BB:BB) solves equation AX=B where A, X, and B are matrices, and where the notation AA:AA means two cells at the upper left and lower right edges of matrix A (e.g. B2:C3 for the 2 X 2 matrix so defined), and the XX:XX and BB:BB notation means the same for the X and B matrices. *U MOVEV mtxa,mtxb moves values from mtxa to mtxb (useful prior to calling MTXEQ). *U MDET mtx This function computes and returns the determinant of matrix mtx. *U MPROD A,B,C This function will multiply matrix A by matrix B giving matrix C, provided that their dimensions are compatible. *U MADDV A,B,C This function adds matrix A to matrix B and stores in matrix C. All matrices must have the same dimensions. *U MSUBV A,B,C This function subtracts matrix B from matrix A leaving the result in matrix C. *U MMPYT A,B,C This function multiplies matrix A-transpose by matrix B and stores the result in ma- trix C; dimensions must be compatible. *U MMPYC A,B,K This function multiplies every element of matrix A by constant K. *U VARY X,A,W,I,P;Q;R;S;T;U;V;W (Equation Solving by Iterative Search) This function allows AnalytiCalc to automatically search for solutions to equations over up to 8 dimensions. The operation is that the accumulators named in the fields shown as P;Q;R;S;T;U;V;W (one to 8 may be specified, only one is required) are varied by a fraction W about their initial values (later scaled down by the gradient of the change in X) to attempt to get accumulator or cell X to equal accumulator or cell A. This is done for I iterations, where I is another accumulator. *U XQTCM command will execute the command (terminated by the end-of-line), with any command except X or K permitted, from inside a cell. This allows command files driven from cells to control moving data, etc. *U STRVL V1,start;len will return a value that is made from up to 8 characters in the FORMULA of cell V1 (where V1 is any cell name), starting at character "start" and for "len" characters. *U HERE will return the current location on the matrix and the current maximum row and column used. T, U get col, row indices of this cell. W, Y get max col, row. V gets flags. *U FFTFW and *U FFTRV perform Fast Fourier Transforms in the forward and reverse (inverse) direc- tions on the given range of data. *U LINEF Vy:Vy,Vx:Vx (with the Vx range optional) fits a line to the input range. y=Ux+T; err in %; corr coeff. in W. *XV filename V1 *XF filename V1 The *X class commands are for sheet linkages. *XF loads a Formula from another saved spreadsheet, while *XV loads a Value. The following *U DBxxxxxx functions also exist as commands of form FILxxxxxx with the same results. *U DBOPINS range filename - Open input sequential on filename for cells in range. (Reads of input range formulas come from file when enabled.) *U DBOPINR range filename Open input random on filename for cells in range *U DBOPINU range filename Open range for update on filename for read and write as random access. *U DBCLSINP Close input *U DBCLSOUT Close output *U DBOPOUTS range filename Open output sequential from range cells to filename. (Writes of formulas in output range go to file.) *U DBOPOUTR range filename Open output random from range on filename *U DBENAINP Enable input file readin (initially disabled) *U DBENAOUT Enable output write (initially disabled) *U DBDISINP Disable input area readin *U DBDISOUT Disable output write *U DBEDTINP range Enables input and output and, for each cell in the given range, reads and writes the cell, allowing the file read/writes to take effect. Each cell is flagged as valid but of text type; the DF command must be used to reset any that should be treated as computable. Input and output are disabled on completion of the command. *U DBFMTOUT range *U DBVALOUT range Enables input and output and for each cell of the range takes the VALUE of the cell, reads the cell, sets it of text type, and writes the text equivalent of its value to the cell. *U DBCMPFRM V1:V2[,V3:V4] Compares two formulas. It returns, in the % accumulator, the index of the formula in cell V2 in the formula in cell V1. Lengths used are those of both formulas UNLESS the V3 and V4 cell arguments are seen. Then V3 and V4 are lengths of V1 and V2 strings used. Accum. W is set to comparison of V1 and V2 (-1/0/+1) *U DBLENFRM V1:V2 returns the length of the formula for cell V1 in the % accumulator and in cell V2 IF CELL V2 IS VALID. Otherwise the cell specified in V2 is ignored, though it must be present in the command or function. *U DBTRMFRM V1:V2,V3,V4 Reads the formula in V1 and uses V3 and V4 as start and end byte numbers within it. It returns to V2 the formula that is between the start and end bytes, trimming the V1 formula into V2 by chopping out the undesired parts. c