













                         A N A L Y T I C A L C



                          The Analyst's Tool



                       User Manual and Reference



                 Copyright (C) 1985, 1986, 1987, 1988
                                G.C.E.

AnalytiCalc Reference Manual                                    Page 2



                         AnalytiCalc Overview
                              AnalytiCalc

      AnalytiCalc  is an electronic spreadsheet program and integrated
 system which was written in  "portable"  Fortran  and  runs  on  your
 AMIGA, PDP11, VAX or MSDOS systems.  It has a variety of commands and
 operates on a "command verb" syntax.  That is, everything you tell it
 is  a  command.   Some  commands  enter  numbers or formulae;  others
 manipulate them or change the  display.   Online  help  is  available
 (though limited) via the Help command (or the HELP key).  

      While   the   primary   functionality  provided  is  that  of  a
 spreadsheet, AnalytiCalc contains means for integrating word process-
 ing  documents, running other programs under its control, integrating
 its graphics output, and  accessing  data  files  created  either  by
 selective  writes  from its own screens or by other programs.  Unlike
 single huge programs which attempt to provide every function known to
 Man in one image, AnalytiCalc is a "second generation" integrated en-
 vironment which provides the "glue" that allows you to use  the  best
 other  specialized programs you can find in a smooth way.  It is also
 constructed to work smoothly with other programs, so  that  you  need
 not give up the communications programs, editors, word processors, or
 database managers you already have.  

      AnalytiCalc  has 5 major ways of addressing cells, over 85 func-
 tions (more depending on how you count them), over 70 commands  (with
 more variations), unlimited windowing and programmability at the cell
 and the sheet level, 16 digit precision, and a built in online calcu-
 lator.   It  is  designed to handle traditional spreadsheet problems,
 data access problems, equation solving, engineering applications, and
 finance,  and  is designed to be easy to extend both by adding to the
 program itself and by adding commands externally.  The entire program
 can be driven from a command file, and individual cells can be driven
 by one or more command files in addition to  formulas;   commands  in
 these  command  files  allow  programmable control of operations with
 very high flexibility.  

      Interfaces  exist  to  graphics  outputs, to word processing in-
 tegration with the spreadsheet (or AnalytiCalc may be used as a  word
 processing  integration tool as a kind of framework document integra-
 tor), to data access from data files separate from the sheet, and  to
 saved  sheets  permitting  access to systems of spreadsheets.  Simple
 methods of moving to other system commands make this program a power-
 ful command interface as well as a unique analytic tool.  

      AnalytiCalc is command driven, though a number of these commands
 are automatically generated  by  function  keys.   Its  commands  are
 mnemonic and intended to be extremely fast to use once learned.  


AnalytiCalc Reference Manual                                    Page 3



      Unlike  nearly  all other spreadsheet type products, AnalytiCalc
 delivers what it promises.  If a cell can be  addressed,  it  can  be
 used,  subject  only to limitations on the amount of disk storage you
 allocate for backing store.  You can use any "n" cells (where "n"  is
 18000  on  the  Amiga or PC) fully with enough disk backup.  Contrast
 this with memory only systems  which  may  address  500,000  or  more
 cells,  but which permit only a few percent of these to be filled be-
 fore running out of room, even on large machines.  (For example,  the
 popular  1-2-3  spreadsheet  on  IBM  PCs is reported to hold at most
 around 12,000 simple formulas on a 544K  machine,  or  around  39,000
 9-digit  numbers.   (Our tests have run out of room at less than 7000
 cells on a  512K  AT.)  In  contrast,  AnalytiCalc  can  hold  32,000
 17-digit  numbers, long formulas, or text strings in its cells, using
 disk store as backup for memory.  The 8088 version currently will run
 in  256K bytes of memory and handle up to 18,000 cells with up to 109
 characters of formula in each.  Thus  the  8088  version  can  manage
 something  over  2.1  megabytes  of  information, while programs like
 1-2-3 V1A are restricted to 0.3  megabytes  approximately  on  normal
 memory  PCs.)  The Amiga version is similar in space to the 8088 ver-
 sion but since it is built  without  overlays  occupies  more  space.
 The Amiga version will run in a 512K machine  with the  non-interlace
 screen and default (4000) stack. Use with interlace  screen  in 512KB
 requires a very minimal environment. The "new CLI" functions will not
 fit in 512K, but everything else should work.

      Since  the  format  of a spreadsheet sometimes needs to vary, no
 simple  fixed  size  can  satisfy  every  need.   For  that   reason,
 AnalytiCalc  allows  its  storage  to  be repartitioned so that up to
 18,000 columns or 18,000 rows may be used.  This is done  under  user
 control  (with  normally  suitable  defaults) and allows use of cells
 anywhere in the 18,000 by 18,000 space.  You cannot  fill  more  than
 18,000  cells (chosen anywhere in the region, since there is no space
 penalty for not using the upper left corner), but you have an address
 range  of 324 million cells.  Legal column names range from A to ZPH,
 and legal row names range from 1 to 18,000, and your display can show
 any  of  this range in as many parts as there are cells shown on your
 screen.  (One application of this would be to use columns  JAN,  FEB,
 MAR,  APR,  MAY,  ...  and TOT for month oriented applications, using
 D## forms of cell addressing to do cross-column sums, if you want  to
 avoid  a line of labels.  This is more of a feat of virtuosity than a
 production technique, but it will work and can be used as you like.) 

                             INTRODUCTION

      AnalytiCalc's  command  structure  is somewhat unique but simple
 and logical once mastered.  Commands you learned for the  spreadsheet
 system  of  your  choice generally are NOT the same as here.  But you
 CAN perform all the same functions.  

      Remember  two  things  first:   in the default mode, you need an
 Enter command ("E ") to enter text or numbers  into  the  sheet,  and

AnalytiCalc Reference Manual                                    Page 4



 floating point numbers (most are floating point rather than integers)
 need a period (.) in them to get AnalytiCalc  to  recognize  them  as
 numbers rather than text.  If you forget the period, the numbers will
 be displayed, but only as labels, and the cell will  have  a  numeric
 value of zero.  

      If  you  want  a  more "traditional" command interface (entering
 just numbers or formulas or labels/text by default and  starting  all
 commands  with a "/", use the command /;  to get into that mode.  The
 prompt will change from > to :  then as a flag and all commands  will
 need to be entered as /command where the command text is as described
 herein.  The descriptions here apply exactly to the  "command-mostly"
 mode, which is the initial default.  The /;  mode is sometimes called
 the "enter-mostly" mode, as  it  is  convenient  for  entering  large
 amounts  of  textual  or  numeric information.  The command "//" gets
 back to "command-mostly" mode.  

      You  can  have  as  many windows onto the sheet on screen as you
 care to define.  Default operation will allow screen redrawing as you
 move  beyond  the edges of the display.  This is more or less a stan-
 dard type scrolling  operation,  and  windows  are  preserved  during
 scrolls,  but  all  move together.  Separate scrolling can be handled
 easily via function keys if desired however.  The NS (NoScroll)  com-
 mand can disable scrolling if desired.  
     Windows on the screen are just regions of the display which point
 to areas on the "physical" spreadsheet.  To conserve pixels, standard
 Amiga windows are not used; the spreadsheet display is in one  single
 Amiga window, with an auxiliary  window  below for some line oriented
 operations and the calculator.
 

      If  the program's display is not as expected, use a V command to
 redraw the screen and/or a R command to recompute to ensure the  dis-
 play  is  really  incorrect.  Automatic recomputation occurs normally
 when data is entered, so  most  invalid  conditions  due  to  forward
 references in equations or lack of an extra recalculation after copy-
 ing is done are corrected in the normal course of  use.   Because  of
 the  slowness  of the cursor controls, AnalytiCalc attempts to update
 only regions of the display requiring it.  It does  so  by  redrawing
 only  cells that change value.  Occasionally a cell which is modified
 from a TEst command or another cell, or a textual cell,  is  not  up-
 dated.   A View command (V) and/or a RF (Recalculate with Force) com-
 mand generally clear up any glitches.  


                   Getting Started with AnalytiCalc

      The AnalytiCalc spreadsheet asks some questions when you run it,
 to set up its working storage.  

                      Initial Questions (Startup)


      Before AnalytiCalc begins with its screen-oriented operation, it
 looks for a file (in the current directory) called ACINIT.PRM.  If it
 exists,  it is read for replies.  If not, AnalytiCalc asks a question

AnalytiCalc Reference Manual                                    Page 5



 about which screen resolution to use. If you are using a non interlace
 screen (640 by 200 ordinarily), specify this. The alternative is the
 interlace (640 by 400) screen. AnalytiCalc will size its displays to
 fit the alternative chosen. If you tell AnalytiCalc to use the 640 by
 400 size on a non interlace (640 by 200) Workbench screen, it will cause
 AmigaDos to crash in some cases. AnalytiCalc just uses windows on the
 (booted) Workbench screen. It also assumes you have already selected
 the Topaz 8 font (80 columns, not 60) in Preferences. If you must use
 a 60 column screen, you will have to manually resize windows and some
 displays after startup. The S command to relocate the bottom two
 rows (command and current contents displays) and DB commands to reset
 the number of rows and columns displayed will be useful in this. (See
 below.)

      If you want a pre-prepared set of replies for AnalytiCalc's ini-
 tial questions, just create a file ACINIT.PRM.  (You need to reply to
 the  first page worth of questions in an ACINIT.PRM file, so the fol-
 lowing example shows sample replies to the others needed.)  A  simple
 way  to  set  up  replies  would  be  to edit in a file ACINIT.PRM as
 follows:  

 N
 Any title desired - use ZA command to reset this.
 22
 22
 1
 1


 The file just contains the replies as though they were entered on the
 screen.  If the file exists,  the  screen  prompts  will  not  appear
 however.  

      After  these commands are put in, any other desired commands can
 also be included to further set up operation.  If you prefer to  come
 up in "enter-mostly" mode, for example, you could put in a command /;
 in this file.  


                            Initial Screen

      When  you  run  AnalytiCalc, it first asks you whether to change
 the default  floating  point  format.   Most  numbers  are  "floating
 point", which means they can have fractional values.  You will seldom
 need integer numbers (which can take on  only  values  -2,000,000,000
 ...   -3,-2,-1,0,1,2,3,4,...   2,000,000,000),  but  will  use normal
 "floating point" ones in which it is legal to have values like  1.35,
 2.5,  and so on.  Just think of "floating point numbers" as a synonym
 for "numbers".  The display format for floating point numbers is ini-
 tially  set  to the Fortran format F9.2 (9 characters wide, 2 decimal
 places), but if you reply Y, it lets you enter any format you like as
 the  default format.  It will try to use it, so if you enter an ille-
 gal format, AnalytiCalc will keep asking for a format until it  finds
 one  that  can display pi (3.14159) correctly.  Note that the default
 sets the format when you first put a value or formula into a cell  to
 be  displayed  numerically.  Once you fill a cell, its display format
 stays until you alter it with the DF command.  Thus if you enter some
 values,  then use the S command (Setup) to change the format default,
 and enter some more cells, only the second group of  numbers/formulas
 entered  will  have the changed display format;  the first group will
 not be changed.  You can have up to 75 separate formats on  a  sheet,

AnalytiCalc Reference Manual                                    Page 6



 chosen from among anything that Fortran can display.  (A minitutorial
 appears later in this manual.) 

      AnalytiCalc  then  asks  you to enter up to 80 characters as the
 Title of the spreadsheet.  This is displayed at the top of the screen
 and is used as a label for the sheet when printed out.  (The space is
 made available for this rather  than  being  wasted  on  a  copyright
 statement on your screen.) 

      To  reply,  enter  any title you like, up to 80 characters long,
 followed (as all AnalytiCalc commands) by a  carriage  return.   This
 will appear across the top of the sheet on screen and in print images
 of it.  You may include any desired leading spaces in the title.   It
 will  be  printed  on screen printouts, so make it descriptive of the
 sheet you'll be using.  (Note it can be excluded  from  printouts  if
 desired  when  row  and column headers are being skipped.) This title
 remains until an S command is given (at which time you can change the
 work  file  also),  though reading in a saved sheet also reads in the
 saved title.  

                      Discussion of Scratch Files

      The  Amiga  and  PC  versions  of  AnalytiCalc use memory arrays
 backed by temporary disk files for values and  formulas.   These  ask
 how many K (bytes) to reserve on disk for the value file and the for-
 mula file.  Generally there should be  somewhat  more  formula  space
 than  value  space  if  many  long formulae are used;  otherwise pick
 roughly equal values.  These scratch files are deleted on  exit  from
 AnalytiCalc-68,  but the sheet will NOT run out of room provided suf-
 ficient file space is allocated.  If it runs out due to lack of room,
 a  message on screen will tell which file is out.  Save the sheet and
 restart then with a bigger file.  The  files  are  allocated  on  the
 default disk when you run AnalytiCalc.  

                                Detail

      Four questions are asked.  First, AnalytiCalc asks how many rows
 and columns you expect to use on the sheet.  Try to  be  accurate  in
 the  replies you give, but great precision is not necessary.  It will
 then compute the necessary sizes of disk files assuming all the  area
 you  gave  will  be solidly filled in and display these sizes for ad-
 vice.  Then, it asks how many K to  allocate  to  value  and  formula
 backing storage.  Reply with what you want to use on disk;  the files
 will be allocated on your default disk and erased on exit.  

      For  a  discussion  of the issues of storage allocation, see the
 Appendix on this at the end of this manual.  

      When  these questions are answered, AnalytiCalc will display its
 Calculation Screen.  

AnalytiCalc Reference Manual                                    Page 7



                      Calculation Screen Display


      The  sheet is displayed at the top part of the screen and a com-
 mand cell in Row 23 is shown with the current position encoded.  This
 starts off looking like 
 
     A  1>   (if in "Command-mostly" mode)
      or
     A  1:   (if in "Enter-mostly" mode)
 

 and  then  AnalytiCalc  awaits  your commands.  Note that if the cell
 pointed to by the command (which is always a Physical sheet  address)
 is occupied (i.e., has ever had any numbers or text entered into it),
 that cell is displayed in the display in reverse video when  you  are
 positioned there.  If the cell is totally empty, it is not displayed,
 however, in any reverse video.  A pattern  of  blanks  is  displayed,
 wherever the cell is null.  This pattern is in reverse video.  
 (In Amiga, the row is not usually Row 23; it is approximately either
 row 17 (non interlace) or row 44 (interlace).)
                                CONTROL

      In "Command-mostly" mode (the default), AnalytiCalc is a COMMAND
 DRIVEN spreadsheet system.  This means that you control the sheet  by
 entering  a  command  followed  by Return.  These commands are in the
 first few  columns  of  the  command  line  and  are  the  first  few
 characters  (often  the first 1 or 2) you type, and they are REQUIRED
 for every command.  AnalytiCalc does NOT assume  any  command  names.
 AnalytiCalc  will translate inputs to upper case unless a " character
 exists in the input string.   Many  of  the  most-used  commands  are
 however  implemented  as single stroke function keys;  the ALT-F1 key
 displays a diagram of these.  The numeric keypad has been implemented
 in as mnemonic a way as possible also, so that arrow keys, home, end,
 page up and down, and control left and right arrows  all  have  their
 expected  meanings.   (For example, End goes to the end of the active
 region, and the INSert key gets into  "Enter  Mode"  (F9  exits  that
 mode) to allow continuous entry of data.) 

      (In  "Enter-mostly"  mode,  AnalytiCalc  is much more similar to
 "traditional" spreadsheets in appearance.  If a / is seen to start  a
 command, a one line prompt will appear in line 25 giving some initial
 character mnemonics for commands.  It is not meant to be  exhaustive,
 but just a reminder.) 

AnalytiCalc Reference Manual                                    Page 8



                               COMMANDS

      The commands available in AnalytiCalc are each described separa-
 tely.  The following is  a  brief  listing  alphabetically  of  their
 names.  Some infrequently used commands are omitted.  

  +J filename                Start journaling to filename 
  +N                         Close journal file 
  <                          Rewind input file 
  %prompt%cmd%key%           Issue prompt and do cmd depending on key 
  $ or }                     Perform operating system command 
  > or >>pattern             Search for formula containing or starting
                              with pattern 
  *                          Comment line 
  -prompt                    Load arguments after prompt 
  //                         Use "Command-Mostly" mode 
  /;                         Use "Enter-Mostly" mode 
  /#                         Swap   current   mode   with   save  mode
                              (command-mostly or enter-mostly) 
  1,2,3, or 4                Move cursor Up, Down, Left, or Right 
  @file.typ                  Read file.typ as input instead of console 
  AA nn {R/C}                Add absolute nn rows or columns 
  AR nn {R/C}                Add relocating nn rows or columns (nn may
                              be neg) 
  CA in-range out-range      Copy All (Absolute) 
  CV in-range out-range      Copy Value 
  CF in-range out-range      Copy Formula (and Format) 
  CR in-range out-range      Copy Relocating (all) 
  DB ncol,nrow               Display Bounds (no.  cols,rows on screen) 
  DF range [format]          Display Format of range to format 
  DL range {R/C}n:m          Display  Locate  range as Row/Col to dis-
                              play col:row n:m 
  DS{R/C}{A/D} n             Display Sort row/col, Asc/Desc row/col n 
  DT range {F/I}             Display Type range as Float or Integer 
  DW ncol,wid                Display  Width  of  col  "ncol"  to "wid"
                              chars 
  E expression               Enter expression into cell 
  E" expression              Enter   expression   as   text,  no  case
                              translation 
  ED 'oldstring'newstring'   EDit cell 
  ET expression              Enter expression as UPPER CASE text 
  EV expression              Enter expression as computable formula 
  F filename/nskip           File read from filename onto display 
  G                          Get saved sheet.  Many variants.  
  Hn                         HELP and show page n 
  IR inrange outrange        In  Place Relocate inrange as if moved to
                              outrange 
  K                          Go   into  interactive  calculator  (need
                              *V 3).  *E goes back.  
  L cell                     Go to cell 

AnalytiCalc Reference Manual                                    Page 9



  M{0/1/2/3/4/5}             Move - set move direction after enter 
  MS or MH                   Macrocell Show or Hide - show or hide in-
                              cluded files.  
  OA cell                    Origin  Absolute  cell  - Map Screen with
                              cell in upper left 
  OAD cell                   Origin   Absolute  Displace  cell  -  Map
                              Screen with cell in upper  left  leaving
                              old windowing alone 
  OR cell                    Origin   Relative   cell   -  map  screen
                              down/right of cursor with cursor=cell 
  ORD cell                   Origin   Relative  Displace  cell  -  map
                              screen   down/right   of   cursor   with
                              cursor=cell leaving old windows 
  OV +                       OVerride absolute refs, make relative 
  OV -                       OVerride off - let abs refs be absolute 
  P                          Put (save) spreadsheet.  Many variations. 
  R                          Recalculate sheet 
  RB cell                    Set Relocate Boundary at cell 
  RF                         Recalculate, Force recalc of constants 
  RM                         Recalculate  Manual  -  no recalc until R
                              cmd 
  S                          Setup - Global mapping/width/title setups 
  TE expression              TEst  -  Evaluate  math expression in cmd
                              mode - many special variants.  
  V                          View - Redraw screen 
  VF                         View  Formulas  -  Draw with Formulas in-
                              stead of numbers 
  VM                         View Manual - no screen repaint until a V
                              cmd 
  VH+, VH-                   View Hack on/off. Controls display of row
                              being calculated during recalcs.
  W                          Write display to file or printer.  
  X                          eXit  from AnalytiCalc.  Asks for confir-
                              mation.  
  ZE range               ZEro range of cells 
  ZA                         Zero  All  of  sheet.  Asks for confirma-
                              tion.  Also used for reinitializing.  


AnalytiCalc Reference Manual                                   Page 10



                          INDIVIDUAL COMMANDS


                           Moving the Cursor
 
         CURSOR MOTION (Commands to move around
                        the sheet one cell at a time)
 
         1               (Move up)     (or uparrow)
         2               (Move down)   (or down arrow)
         3               (Move left)   (or left arrow)
         4               (Move right)  (or right arrow)
 

      The  cursor  motion  keys  move the cursor on the display in the
 direction indicated.  Note these keys are in the same  order  on  the
 keyboard as the arrow keys of the VT100.  

      NOTE THAT THE KEYS 1 TO 4 ARE INTERPRETED IN THE SAME WAY AS THE
 UP, DOWN, LEFT, AND RIGHT ARROW KEYS ON THE VT100.   THEY  APPEAR  IN
 THE SAME ORDER AS THE ARROW KEYS ON THE VT100 ON THE KEYBOARD.  

      The  X  and  Y accumulators are set to the column number and the
 (row number + 1) respectively  during  commands.   This  allows  pro-
 cedures  to detect cursor position or motion where useful.  These ac-
 cumulators may be used within cells  for  anything;   resetting  them
 does not move the cursor.  

      If the arrow keys move to the edge of the screen (or if auto mo-
 tion does this), an automatic  OA  command  is  done  to  effectively
 scroll  the  entire  viewing  screen by the number of rows or columns
 minus 2.  The command  NS  (meaning  No  Scroll)  will  inhibit  this
 redrawing.   The scrolling can be re-enabled by giving the command SC
 (SCroll).  These commands do not redraw anything nor  do  they  cause
 recalculation;   they merely toggle an internal control.  The initial
 state is SCroll mode.  



AnalytiCalc Reference Manual                                   Page 11



                   Insert or Delete Rows or Columns
 
       ADJUSTING PHYSICAL LOCATIONS
       (Adding or Removing Rows or Columns)
     AA  number  R     Add "number" rows ahead of the current physical
            position, moving all cells below the current cell down  by
            "number"  rows  and  losing  the  physical  sheet's bottom
            "number" rows' contents, NOT adjusting variable references
            where the variables are in the moved range and are not the
            position independent (P## or D## forms) type.  
     AA  number C     Add "number" columns ahead of the current physi-
            cal position, moving all cells right of the  current  cell
            right  by "number" columns and losing the physical sheet's
            bottom "number" columns' contents, NOT adjusting  variable
            references  where the variables are in the moved range and
            are not the position independent (P## or D## forms) type. 
     AR  number  R     Add "number" rows ahead of the current physical
            position, moving all cells below the current cell down  by
            "number"  rows  and  losing  the  physical  sheet's bottom
            "number" rows'  contents,  adjusting  variable  references
            where the variables are in the moved range and are not the
            position independent (P## or D## forms) type.  
     AR  number C     Add "number" columns ahead of the current physi-
            cal position, moving all cells right of the  current  cell
            right  by "number" columns and losing the physical sheet's
            bottom  "number"  columns'  contents,  adjusting  variable
            references  where the variables are in the moved range and
            are not the position independent (P## or D## forms) type. 

      These  commands  permit  the  operations  known  on other spread
 sheets as "insertion" or  "deletion".   Deletion  takes  place  where
 "number"  is negative and the sense of the motion is reversed.  These
 commands change the physical sheet's contents  and  permit  wholesale
 modifications  to  variable  names (other than P## or D## forms which
 are position independent already and are left  alone  for  simplicity
 and to preserve some of the flexibility of the D## forms which can be
 used for projections of 3D sheets onto  the  display  and  math  with
 ranges  of these).  To save a sheet for merging such selected values,
 both forms, or at least the numeric form, of the Put commands  should
 be used.  

      Note  that the previous contents of the rows or columns inserted
 is RETAINED, though it can be zeroed by the ZE  command  if  desired.
 It  will  have  been  copied  also  to  the  lower  or  further-right
 row/column also, but do not be alarmed;  the space is free to re-use.
 You may however elect to use this feature as a shorthand for copy.  

      The AR/AA operations take place on the physical sheet and do not
 affect the display sheet mapping to the physical sheet.  

AnalytiCalc Reference Manual                                   Page 12





                     Copying and Replicating Cells
 
      COPYING CELLS
 
    CA V1:V2 V3:V4    Copy all cell attributes from V1:V2
                       to V3:V4.
    CV V1:V2 V3:V4    Copy numeric values only
    CD V1:V2 V3:V4    Copy Display Formats only
    CF V1:V2 V3:V4    Copy Formulas only (no relocation)
    CR V1:V2 V3:V4    Copy all cell attributes as in CA
                but relocate cell names to new location
                from old one. Only relocate names right
                of or below the cursor or on same row/col
                with cursor (cells above or left of cursor
                are NOT relocated).
    IR V1:V2 V3:V4    Relocate formulas inplace, computing
                displacements using distance "moved".
 

      The Copy commands let you reproduce cells' contents in other lo-
 cations on your sheet without re-entering them.  The CA form is  most
 useful,  though the CD part can be used to change default formats and
 the others may be handy.  Note that formulas are NOT changed  by  the
 copy operation.  If they should function correctly in their new loca-
 tion relative to different cells, the cell identifications should  be
 position  independent  forms  (P#n#m  for  forms relative to physical
 sheet, D#n#m for forms relative to display sheet) so no  modification
 is  necessary.  CA will normally save all information about a cell in
 the new cell.  

      Unlike  the other C class commands, the CR command WILL relocate
 any variable names that are below or to the right of  the  cursor  at
 the time the command is given.  Names above or left of the cursor are
 not changed.  The row and column the cursor is in is included in  the
 relocation  region.  Thus, to be sure names are relocated, use a com-
 mand like L A1 first to position yourself at the top left part of the
 physical  sheet.   BE  SURE  YOU  DO THE REPOSITION IF YOU USE THE CR
 COMMAND!!!!!!!  Note however that if you need certain cells NOT to be
 relocated, the ability to place them above or left of the cursor when
 copying or replicating cells around and having them left alone can be
 useful.   Normalization  factors,  for  instance,  can  be left alone
 (e.g., at the top of a column) and cells referring to them be  copied
 without having them point to the "wrong" normalization cell.  

      When  you  specify  one  variable to the C class commands in the
 V1:V2 range location and give a range V3:V4, the  command  will  copy
 the named V1 into all cells in the V3:V4 range.  


AnalytiCalc Reference Manual                                   Page 13



      The  IR  command  allows  inplace  relocation of formulas.  This
 operates from the cursor to the Relocate Boundary (see  below).   The
 *U HERE function returns the current maximum column used in the W ac-
 cumulator and the current maximum row used in the  Y  accumulator  to
 permit  the repeated use of IR from a command file to simplify moving
 sections of the sheet.  


                   Setting Size of Display on Screen
 
       DISPLAY BOUNDARIES SETTING (Number rows/cols)
 
     DB n,m    Set number of columns displayed on screen
                 to n, number of rows displayed to m.

      The DB command sets display size.  It also effects the number of
 cells modified by the OA and OR  commands,  so  setting  the  display
 small,  doing an OA or OR, then setting it large, leaves the part om-
 itted as it was before the OA or OR.  The displayed window also  con-
 trols  what  is  read in with the F command.  Note that for automated
 text retrieval, the VM command (to turn  off  redisplay  during  com-
 mands)  may  be  useful  in connection with using DB commands, F com-
 mands, and then V commands to turn the display updating back on  from
 command  files  invoked either by auxiliary keypad keys or from @file
 commands.  

 For an example of DB, if you want a display of 14 columns by 20 rows,
 the command 
       DB 14,20 
 would be the way to achieve it.  

      When  a narrow screen (e.g.  a 40 column screen) is used, the DB
 command may be used to reduce the number of columns  shown  to  allow
 AnalytiCalc  to  operate.   If  your  screen  supports  more  than 80
 columns, AnalytiCalc will allow their use by increasing the number of
 columns seen.  

      The  maximum bounds for DB are usually larger than a real screen
 will hold, but the W command will write out up to these larger bounds
 to  allow long sheet printouts.  On the Amiga version, up to 75 lines
 length are permitted per page.  



AnalytiCalc Reference Manual                                   Page 14



                        Setting Display Format
                                  and
              Changing between Formula and Number Display
 
       DISPLAY FORMAT SETTING
 
       DF V1:V2 [format]   Set Display Format AND
                             set up whether to
                             display formula or number
 

      The DF command sets the display format for the variable range V1
 to V2 inclusive to be whatever is in the square  brackets.   This  is
 expected  to  be  a valid FORTRAN FORMAT specifier for display of the
 number and may be up to 9 characters long.  If the  format  specifier
 entered  is  however  just A or L in the first character, the program
 will indicate the text is to be displayed literally, not as a number,
 so  titles and such can be shown.  To display numbers in Fortran A or
 L forms, just use formats like 4A1 or similar;  as long as  there  is
 something  ahead  of the A or L it goes to Fortran.  The program will
 try your format once before writing to disk  to  ensure  against  any
 crashes  that  will damage your file.  Otherwise, the format is up to
 you.  You can even display in octal or hex if you wish!  

      The  DF command is used to switch a cell from display of numeric
 information to formula/text display or back on a cell by  cell  basis
 (the  VF  command globally switches cells from numeric to formula and
 back, though a cell set to  display  text  with  DF  always  displays
 text).   To  change  a  cell to numeric, merely use the DF command to
 give it a numeric format (the default is normally F9.2 so the command
 to set, say, cell G3 to be numeric (possibly after entering a formula
 not containing +, -, ., (, or [ characters) would be:  

     DF G3 [F9.2] 

 for the standard Fortran F9.2 format (2 decimal places, 9 digits wide
 display).  In AnalytiCalc-VM, every cell may have an entirely  unique
 format.   In  AnalytiCalc-PC, however, only a finite number of unique
 formats is possible (usually about 45) since storage  is  in  memory.
 The  design  limit  is  255 unique formats, but very few spreadsheets
 will need more than the 45 normally provided.  Typical ones only have
 2  or  3  unique  formats.   The  formats  may be ANY Fortran formats
 desired.  

      The  DF command will also set the type to Floating if the format
 begins with F or E, and will set the type to Integer  if  the  format
 begins with I.  Beyond this (e.g., for octal or hex) you must use the
 DT command (below) to set the storage to floating (8  bytes)  or  in-
 teger (4 bytes).  


AnalytiCalc Reference Manual                                   Page 15



      The  DF command will attempt to avoid erroneous format inputs by
 trying the format out on your current location.  If errors occur, the
 DF  command  will be quietly ignored, and the program will not crash.
 This makes it difficult to switch to integer displays.  To  switch  a
 cell  or  range  to  integer, you must use the L command to move to a
 cell not shown on the screen, then use the DT command to  change  the
 desired  cells to integer type, then use the DF command to change the
 display format to an integer display format.   The  cells  will  then
 work  correctly  as  integer  cells.

      A  cell  may be switched back to* its previous numeric format by
 using the command DF v1 [*] where v1 may be a cell  or  range.   This
 allows  temporary  examination  of  formulas and resetting to numeric
 without losing the format.  

                           What Is Displayed

          NOTE:  
          There are 2 items in any cell which may be  displayed.   One
          of  these  is the number in the cell, which takes 4 bytes if
          an integer, 8 if floating point, and which is displayed nor-
          mally  using  a  Fortran  FORMAT statement type declaration.
          The other is the FORMULA associated with the cell, which may
          contain just text or labels.  This is selected by the A or L
          formats.  

               Thus, the declaration 
          DF A1:A64 [8A1] 
          would  display  the NUMBERs in column A as 8 characters (as-
          suming this makes sense), and would cause strange errors  if
          the number did not make sense as characters.  
          The declaration 
          DF A1:A64 [A] 
          would  display  the  FORMULA TEXT in column A on the screen.
          This normally will always make sense, and is the normal  way
          to display labels.  

                         FORMAT microtutorial

      To  reset  FORTRAN  Formats, the Fw.d format is useful.  In that
 format, w means an integer giving the width in characters of the out-
 put  number,  and d is the number of decimal places to be shown.  For
 example F9.2 has 9 places total, 2 to the right of a  decimal  point.
 A valid number in this format might be (supposing its' exact value is
 123456.782) 
      123456.78 
      The format F9.1 would give 
      123456.8 (note rounding) 
      The format F10.3 would give 

AnalytiCalc Reference Manual                                   Page 16



      123456.782 

      You   may   devise   whatever  formats  desired.   In  addition,
 AnalytiCalc will only display the number of characters  that  fit  in
 the column on screen, so display width can be set to remove undesired
 decimals.  

                          Other FORMAT types

      The  default F9.2 format occupies 9 of the default 10 characters
 of column width.  Where additional labels are needed, the 1Hc or 2Hcc
 formats may be used.  For example, to show dollars, one might write a
 format as [1H$,F9.2] in the DF command.  If  as  an  alternative  one
 wanted  to show thousands of dollars with one decimal place, a format
 like [2H$K,F9.1] would place "$K" ahead  of  each  number.   Thus,  a
 value of 345.67 in the first format would look like 
 $ 345.67 
 and in the second format it would look like 
 $K 345.7 
 (since the spreadsheet only knows numbers, not their dimensions).  

      Where it is desired to display large numbers, FORTRAN offers the
 E and G formats (the form of such a format is Ew.d or Gw.d where w is
 the  width  of  the  number as printed and d is the number of decimal
 points).  The E format displays the number as a fraction followed  be
 E  followed  by a power of 10.  The G format chooses a floating point
 display or an E format depending on the number's size.  Note that  in
 E  and G formats, there need to be 4 spaces in the decimal field just
 for the exponent.  

      The  format  you  display  in may be wider than the column;  the
 first "n" characters of the number are shown, where "n" is the  width
 of  the column.  Thus, if you use a format like F10.0 (which displays
 10 digits followed by a period), the period  will  not  show  in  the
 default 10 character column width.  

      Available  format  designators  for  floating  numbers (the ones
 you'll use almost always) are:  
     Fw.d  - Simple display with w characters of display (counting the
 decimal point) and d decimal places after the decimal;  
     Ew.d  - Display as a fraction followed by Enn where nn is the ex-
 ponent of 10 to multiply the fraction by.  The format kPEw.d causes k
 digits  to  be  displayed to the left of the decimal place, so that a
 format of E10.5 might display the number 73.453 as ".73453E+02" and a
 format of 1PE10.4 would display it as "7.3453E+01".  The w is the to-
 tal number of characters in the display, and  the  d  the  number  of
 decimals shown.  Note that the w must have 4 extra characters to han-
 dle the "E+nn" part of the number.  Very large or small  numbers  can
 be handled by this format where they would be too wide in F format.  
     Gw.d - This format works like the Fw.d format provided the number

AnalytiCalc Reference Manual                                   Page 17



 is small enough to fit in the widths  provided,  and  like  the  Ew.d
 format otherwise.  The display will include only d digits (or k+d di-
 gits if using kPGw.d), so for cases where it works, the  Fw.d  format
 is more space efficient.  
     Several "modifier" formats are available.  nHxx allows characters
 xx in the output.  nX includes n spaces.  TRc causes the next  output
 to  appear  c spaces right of the current one, and 'xx' acts like the
 nHxx in outputting characters xx.  The 'xx' or nHxx designators  must
 be  separated  by comma from following format designators.  Also Dw.d
 is equivalent to Ew.d.  The optional forms Ew.dEe and Gw.dEe act like
 Ew.d and Gw.d except that only e digits of exponent are displayed.  


                Fine Control Remapping Displayed Cells
 
      DISPLAY LOCATE (Map physical sheet variables
                      onto Display Sheet)
   DL  V1:V2 Rn:m    point at display coordinates (n,m) (col,row) and,
          going left to right  along  a  Row,  copy  in  variables  V1
          through  V2  (actually,  point  those display sheet cells at
          variables V1 thru V2).  
   DL  V1:V2 Cn:m    point at display coordinates (n,m) (col,row) and,
          going top to bottom along a Column,  copy  in  variables  V1
          through  V2  (actually,  point  those display sheet cells at
          variables V1 thru V2).  

      The  DL command lets you associate any variables in the physical
 sheet with any location on the display sheet (the display sheet coor-
 dinates  always  count  from 1 as the topmost row or leftmost column,
 through the maximum number there).  This flexible  association  means
 that  in  principle every cell on the display sheet can be a "window"
 in the sense of other sheets, though that would be quite hard to fol-
 low.   If  the  :V2 part of the command is left off, only one display
 cell is changed.  This command is present to give "fine grained" dis-
 play  control.   Most of the time the OA and OR commands will be used
 instead, but this command allows you to tailor a display  as  needed.
 It  is recommended that the journalling be turned on before you issue
 many DL commands to capture them into a file that can be played  back
 (via @file) to recreate the display mapping.  The +J file and +N com-
 mands turn journalling on and off.  



AnalytiCalc Reference Manual                                   Page 18



                    SORTING DISPLAY ROWS or COLUMNS
         SORTING DISPLAYS
 
    DSRA#nn   Sort display on row/col nn (display coord)
 

      The  DS  command  sorts  "normally"  ordered display sheets.  It
 operates something like a sorted OA command, the sort key  being  the
 number in a column or row.  The command looks like this:  
 DS Command specifier 
 R  or  C  - Row or Column specifier (i.e.  whether to sort a row or a
 col.) 
 A or D - Ascending or Descending order sort 
 nn - row or column number to sort on.  

      The command letters must all appear together.  Thus a command to
 sort Column 4 on the display in Descending order would be:  
 DSCD 4 
 and a command to sort Row 3 in Ascending order is:  
 DSRA 3 

 The  sheet  should be in "normal" order (as from an OA command) prior
 to the sort for use.  The area sorted is the part of the  sheet  dis-
 played  (set  by the DB command, so it may actually exceed what shows
 on the screen.  The Amiga version of  AnalytiCalc  normally  supports
 very  large display sheets to permit printout of large displays which
 are not all visible on the screen;  the screen display  discards  all
 the  un-displayable  points, but the print routine, and the sorts, do
 not.) That is, the display sheet size may be  given  as  larger  than
 your  screen  will  display, and the sort will cover that area.  Note
 that ONLY display sheet locations are sorted.  A sort on the PHYSICAL
 sheet  may  be  done  via a cell or sheet program, but this primitive
 does not.  



AnalytiCalc Reference Manual                                   Page 19



                           DATA TYPE control
 
       DATA TYPE SETTING
 
     DT V1:V2 F    Set V1 thru V2 to Floating data type
     DT V1:V2 I    Set V1 thru V2 to Integer data type
 

      The  DT command sets Float/Integer attributes on physical cells.
 Initial default is F (8 bytes) but this can set it to I (4  byte  in-
 teger).   Computation  is  done  in floating point always, but I type
 variables will be converted to integer when stored and  may  be  dis-
 played in valid Fortran formats.  This information is stored/restored
 by the P/G class commands.  The type flag may also be set with  a  DF
 command,  which  recognizes I formats as implying that data is of in-
 teger type (if the first character of the format is an I)  and  treat
 other  formats  as  floating point (real) data.  The integer data can
 hold up to + or - about 2 billion.  The floating point representation
 permits  nearly  unlimited size numbers but only has 16 (roughly) di-
 gits precision.  Integer  arithmetic  is,  within  its  valid  range,
 exact.   When  integer data is retrieved, it is converted to floating
 point for calculations and converted back upon storage;  this  avoids
 many potential internal problems of function validity.  


                         Setting Column Width
 
         DISPLAY WIDTH SETTING
 
     DW N,M     Set column N on display to be M
                   characters wide
 

      DW  lets you set any column width.  They are independent of each
 other, and may be set in any order.  Maximum width supported  is  132
 columns.  Note that when many widths are to be varied, the VM mode is
 useful to prevent redrawing the screen between settings;  the V  mode
 can  then  be  reset  once the widths are as desired.  Setting column
 widths is expected to be frequently done via a command file (see  the
 @ command below).  The column number is normally displayed across the
 top of the screen along with the physical  cell  the  display  column
 currently  is  pointing  to  on the top row.  This is shown in a form
 like "AF = 4" in reverse video (or different colors).  You use the  4
 in  this command.  Because some commands (notably this one and the DL
 command above) use DISPLAY coordinates, the columns are  labelled  in
 this  way  to make it easy.  Rows are not labelled because the labels
 take too  much  space  on  screen.  Note that the width is set in the
 DISPLAY in AnalytiCalc,  not on the PHYSICAL sheet.  Thus, if you set
 the third column width  to 20 (so column C initially is 20 characters
 wide, let's say) and then  scroll over so column H is the third over,
 column H will have the 20  character  wide display, because the width
 is part of the DISPLAY mapping and  does  NOT  attach  to  individual
 cells.    This  is done because cells in  a  display  column  can  be
 remapped in any way the user wants and no  other consistent method is
 available.



AnalytiCalc Reference Manual                                   Page 20



                             EDIT command
 
         EDIT FORMULAS
 
  ED 'string1'string2'  Replace string1 with string2
                        in current cell formula. Either
                        string may be null if desired.
 

      The  ED command allows editing of formulas with some extra bells
 and whistles.  Basically, the new string replaces the old one, EXCEPT
 that it is possible to do some limited argument replacement.  

      The  constructs  &1  through  &4 will be replaced by arguments 1
 through 4 as last entered by the "-" command (see below).  These  may
 be  from  0 to 51 characters long each, and multiple & constructs may
 appear in a substitution.  No & constructs may recurse,  however.   A
 second  ED command can have the effect of the recursion in some cases
 however.  

      The  construct &5 will evaluate accumulator Z and, if it is in a
 range where it may be so represented, take its integer part and  con-
 vert it to a numeric string (up to 10 characters) in the place of the
 &5.  

      The  construct &6 will replace the cell with the contents of the
 integer part of accumulator Z provided that that number is between  1
 and  256.   Thus, any single non-null ASCII code can be entered.  Ac-
 cumulator Z is used to avoid conflicts with %, which is used too fre-
 quently  to reserve for this purpose.  To set up Z interactively to a
 constant, the command "TE Z=nn." will set Z to the value nn.  

      The EDited formula is re-entered into the cell after the edit.  

      If  the  initial  string  is  null, the EDit command appends the
 replacement string onto the contents of the cell.  If the replacement
 string  is null, the corresponding contents of the cell's formula are
 deleted.  Note that ALL matching strings in the formula are replaced,
 not  just the first.  If automatic motion has been specified after an
 Enter, it also occurs after an EDit.   This  allows  a  "dummy"  EDit
 (e.g.   ED  / / /)  to  simply  move in the default direction without
 changing any formulas.  




AnalytiCalc Reference Manual                                   Page 21



                                 ENTER

                (Entering Data and Expression Formats)

         E expression       Enter expression and set as formula
                               or text based on contents
         ET expression      Enter expression and set as text
         E" expression      Enter expression and set as text.
                               Note this form does NOT
                               translate to upper case.
         EV expression      Enter expression and treat as
                               computable.
 

      This  command enters the given expression at your current cursor
 position, and may optionally move in some direction that has been set
 up by the M command (Move) after the entry is made.  

      The Expression may be text or one or more numbers, functions, or
 equations (separated by the \ (backslash) character if more than  one
 per cell) in fully parenthesized infix notation.  The expressions en-
 tered resemble normal algebraic expressions, with the usual  operator
 precedence.  There are 26 global accumulators named A through Z (plus
 a special one named %) available;  the result  of  a  calculation  is
 always  left  in  the  %  accumulator as well as the cell.  Operators
 available include addition (+), subtraction (-), multiplication  (*),
 division  (/),  and exponentiation (** or !), with normal precedence.
 Many functions are also available, described below, for other  opera-
 tions.   The  operator evaluation order is functions, exponentiation,
 multiplication and division, addition and  subtraction,  just  as  in
 Fortran  and  most  programming  languages (and on most calculators).
 Parentheses may be used  to  group  calculations  to  override  these
 defaults.  

      Simple examples of Enter are:  

 E 523.458         Enter the number 523.458 into
                    the current cell
 E SUM[A3:A15]     Enter the formula to compute the
                    sum of cells A3 through A15 and
                    produce the result in the current
                    cell
 E MONTHLY REVENUES 
                   Enter the label "MONTHLY REVENUES"
                    into the current cell. Notice that
                    the string does NOT have any of the
                    characters .[(+_ in it, so it is
                    treated by default as a label.
 E (A2+A4+A6+A8+A9*A10+A11*A12)/(SUM[A2,A4,A6,A8]-A13)
                   Places the above formula into the cell

AnalytiCalc Reference Manual                                   Page 22



                    so that it will be evaluated. The
                    multiplications and divisions are done
                    before additions and subtractions, as
                    is the normal mathematical standard.
                    The formulas may of course contain
                    references anywhere on the sheet; they
                    do NOT have to all refer to the same
                    row or column.

      The  text  entered  becomes  the  Formula  for  that  cell,  and
 AnalytiCalc takes a guess as to whether that text is just text  or  a
 number  to compute.  If the text contains any of the characters (, +,
 -, ., or [, it is assumed to be a formula, and the cell is marked  as
 containing  a  computable formula.  Otherwise it is just treated as a
 label and the formula itself is displayed.  If you find the guess  is
 not  to  your  liking, the DF command below lets you alter the format
 and tell AnalytiCalc that the entry is / is not a numeric.  An  addi-
 tional  special  character  is  the '"' (double quote) character.  If
 this character appears any- where in the entered formula, AnalytiCalc
 will  take the formula as text, regardless of whatever else is in it.
 You can also combine comments and formulas by using a separate state-
 ment and the *C construct 
 (e.g.  SUM[A3:A12]\SQRT(%)\*C SQUARE ROOT OF THE LENGTHS) 
 of  Calc.  Once a cell is set up as numeric or text, it remains as it
 was originally set until changed (using  the  DF  command,  described
 below).   The  ET and E" forms of the Enter command force the expres-
 sion to be entered as non computable so that it is  displayed  rather
 than  computed.   The EV form forces it to be computed, regardless of
 whether any special characters exist.  Numbers MUST have decimals  to
 compute  properly however.  Thus "EV 45" is INCORRECT, where "EV 45."
 is CORRECT (assuming you want the value 45.   to  be  computed;   the
 first will not).  If the decimals are omitted, the expressions may be
 considered integer.  These will be converted, but the conversion  has
 some  limitations  and  is  advised  against.  Also, integer division
 truncates results to produce an integer result  (so  that  7/2  would
 evaluate  to  3,  while  7./2.   would evaluate to 3.5, for example).
 Thus, to avoid surprises, use decimals.  

      Commands  will  be translated to upper case unless a " character
 appears anywhere in the command.  If a " character is found, only the
 first 2 characters are converted.  

      Most  keys map to indirect files to make customizing AnalytiCalc
 easier.  These files must be in your current directory  to  be  found

AnalytiCalc Reference Manual                                   Page 23



 (or  a  path  search  utility must be used).  The system help file is
 called PCCHELP.HLP and must also be in your current directory to  en-
 able the HELP command to work.  However, where filenames are prompted
 for, AnalytiCalc can accept full pathnames.  If  the  program  cannot
 open a file for reading which is requested, it will attempt to create
 an empty file (and warn you of this on the top line of the screen).  

      Within  command  files,  it is sensible to permit entry from the
 console of commands after prompts.  Therefore the % command has  been
 added  to  facilitate  such entry.  There is an alternative method of
 handling prompts (the "-" command) but  this  one  is  somewhat  more
 flexible.   You  will find examples of this in some of the .CMD files
 supplied with AnalytiCalc, and may use it in  your  own  if  desired.
 The  operation  is  as  follows:  a line beginning in % is assumed to
 have several fields:  

 %FLD-1%FLD-2%FLD-3 

 in  which  FLD-1  if  present is typed out to the screen first.  Then
 FLD-2 is passed as the command.  If FLD-3 exists and starts with a  ?
 or  \, then the terminal is read and the result is added onto the end
 of FLD-2 before the command is passed back to the spread  sheet.   If
 the  command begins with a space or control character or a \, then it
 is commented out and the command file falls  past  the  %  line.   If
 however FLD-3 started with ? and the initial read-in character is not
 \ or a control character, the command file is rewound.  This  feature
 is  used  in  the enter command file (AKD.CMD) to implement an "enter
 mode" somewhat akin to that of Visicalc, Supercalc, or others of that
 ilk by automatically inserting the "E " of the AnalytiCalc Enter com-
 mand until a \ is seen.  If FLD-3 should be present and start with  a
 &  character,  the  auxiliary  file is closed there and console input
 done as in \ input.  (Note that a control-Z may be used to  terminate
 Enter  mode  also,  and  F9  is  preset  to terminate it.) This func-
 tionality is probably less convenient than just using the /;  command
 to  go  into "enter-mostly" mode now, and should probably be ignored.
 It is handy in templates to be used by novices though, since it gives
 extremely easy console data entry in a controlled fashion.  
                               Examples

      The expressions that are entered can be numbers or formulas  re-
 lating  numbers  and  other  cells.  They may also consist of several
 statements separated by a \ character which will all be evaluated  at
 that cell, up to 110 characters.  Thus, valid commands might be 
 
   E 55.234      Enters value 55.234 at current cell
   E B4+H2+D5    Cell will contain the sum of cells B4,H2,
                 and D5.
   E Totals      Cell contains literal text "Totals".
 
                               FORMULAS

AnalytiCalc Reference Manual                                   Page 24



      Formulas  may  be used too.  These include 2 classes.  The first
 are the multi-argument functions, which either appear at the start of
 their  statements  or  substatements  (alone), or inside expressions.
 The difference between the classes is that  the  multiargument  func-
 tions  must  have  cell NAMES or RANGES as their arguments, while the
 single argument functions can have arbitrary Expressions in their ar-
 guments.   Otherwise they may mix freely.  All functions listed below
 may appear in command files or cells, and arguments  must  be  cells,
 not  expressions or constants.  The IF statement, while it is treated
 as a function syntactically, may NOT appear  inside  general  expres-
 sions,  but  must begin a cell equation or sub-equation (i.e., it may
 begin after a \ in a cell containing several operations).  It  cannot
 be  used inside command files driving cells, but its functionality is
 supplied there by the "*J label" function, so no real limitation  ex-
 ists on capability.  

 The available multiple argument functions are:  
   SUM[variables]     Sum of all arguments
   MAX[variables]     Max of arguments
   MIN[variables]     Min of arguments
   AVG[variables]     Average of arguments
   AVE[variables]     Average of arguments ignoring cells
                      containing 0.0 (e.g., labels)
   STD[variables]     Standard deviation squared
   IF [V1.rel.V2] statement | else-statement
   AND[variables]     Boolean AND of all variables in list
   IOR[variables]     Boolean inclusive OR of variables
   NOT[variable]      Boolean complement of variable
   XOR[v1,v2]         Boolean exclusive OR of v1,v2
   EQV[V1,V2]         Boolean "equivalence" of V1,V2
                      (complement of exclusive OR, true if
                      bits have the SAME value)
   CNT[variables]     Number of nonzero variables in list
   MOD[V1,V2]         Returns V1 modulo V2 (i.e., remainder
                      of V1/V2 division.)
   SGN[v1]            Returns 1.0 times sign of V1
   LKP[var,variables] Lookup variable in "variables" range
                      greater or equal to var, return its
                      index (starting with 0) into variables
                      range.
   LKN[var,variables] Lookup variable in "variables" range
                      less than or equal to var, return its
                      index (starting with 0) into variables
                      range.
   LKE[var,variables] Lookup variable in "variables" range
                      strictly equal to var, return its index
                      (starting with 0) into range. Note all
                      LKP, LKN, LKE return the last variable
                      index if no satisfactory value found.
   NPV[disc,vars]     Net Present Value of vars (equal time

AnalytiCalc Reference Manual                                   Page 25



                      interval numbers), at discount rate
                      disc where disc is a fraction
                      (e.g., .12 for 12%). Be sure the arguments
                      are all cells, not literals, including the
                      disc argument. Set a cell to the fraction
                      desired for the disc argument and use its
                      name in the arguments to NPV, rather than
                      attempting to use a literal (e.g., 0.12)
                      directly.
   IRR[PV,FV,returns] Internal Rate of Return. Will compute
                      internal rate of return on up to 20
                      periods, returning rate per period.
                      The returns are expected to be at
                      equal time intervals. PV and FV are
                      initial and final values of investment
                      and the result is computed via Newton
                      approximation. As with all functions here,
                      be sure all arguments are cell names, not
                      literal numbers.
   PMT[princ,inter,nper] Payment function. Generates payment
                      given principal amount, interest per
                      period (as a fraction), and number of
                      periods.
   PVL[pmt,inter,nper] Present Value function. Generates present
                      value of a loan given payment amount, 
                      interest rate, and number of periods.
                      All financial functions assume that
                      payments are for equal time intervals.
   RND[V1]            Random number. Generates a random number
                      distributed uniformly in the interval
                      0.0 to 1.0. An argument is required but
                      never touched.
   CHS[Idx,Range]     Choose cell from range based on value of cell
                      Idx. If cell IDX contains 1, first element of
                      range is chosen; if 2, second, etc. Zero is
                      returned if out of range. Range can be any
                      comma-delimited list of ranges also.
   ATM[A1,A2]         Arc Tangent of A1/A2, but four quadrant 
                      version. Note these are single cells.
 
 In  all  cases  except  IF, arguments are variable names separated by
 commas, or variable ranges, or mixtures separated by  columns.   Note
 too  that  ALL  THESE  FUNCTIONS  REQUIRE  CELLS  OR  ACCUMULATORS AS
 ARGUMENTS;  literals and single argument functions may  NOT  be  used
 here.   (That is why it is easy to place multiple commands on a line;
 the ACs or cells may be loaded in "separate" steps.) The IF [] state-
 ment  is a partial exception since a range may be used to replace ei-
 ther variable inside the []  condition  brackets.   The  sum  of  the
 ranges will be used in that case.  A possible IF statement might look
 like 

 IF [S2.LT.S5] R=2. | R=0.  

 The Boolean variables are computed by taking the  integer  values  of
 the  variables  and performing the appropriate boolean masking opera-
 tions on them.  The values are returned as whatever type (floating or
 integer)  the  cell is.  32 bit integers are used.  The CNT operation

AnalytiCalc Reference Manual                                   Page 26



 will (generally) omit cells that have  not  been  initialized,  since
 these  have a value of 0.0 and are not changed unless modified expli-
 citly.  It may be used to compute a more accurate  average  than  AVG
 where  many  uninitialized cells add zero values in.  The quotient of
 the SUM divided by the CNT of a range will give an average of nonzero
 cells  only.  The LKP function quickly locates a cell in a list where
 the value is in a desired range;  the *G function may be used to  ex-
 tract  other  cells  close  to the addressed cell (e.g., beside it or
 below it).  The LKN and LKE functions are exactly the same but search
 for lower or equal values instead of greater than values.  This makes
 varied search strategies easy to do.  These functions are most useful
 in  user  command files for selecting parts of the sheet according to
 criteria, as they allow very fast searches  of  large  parts  of  the
 spreadsheet  from  inside command files.  In this application the LKP
 class functions would be accessed via  the  TEst  command.   The  NPV
 function is the standard financial Net Present Value function, assum-
 ing the discount rate is the fractional interest percent  per  period
 for  the  amounts  in  the range given, and that the range of numbers
 represents equal time periods.  Remember to give  a  FRACTION  rather
 than  a  Percent, so a 5% interest rate per period should be given as
 .05 for example.  The IRR function will  compute  IRR  given  present
 value,  future  value, investments per period (for up to 20 periods),
 and assuming that the periods are equally spaced.  The IRR value  re-
 turned  is  per  period and must be multiplied by periods per year to
 get a yearly rate.  Note that other financial functions like PMT  may
 be  easily  obtained  by  simple  cell programs.  The RND function is
 provided to give random numbers.  This is useful  in  some  types  of
 Monte Carlo financial modelling.  If distributions other than uniform
 ones of random numbers are desired, they may be obtained via standard
 mathematical  transformations  from  this  uniform distribution.  The
 random number sequence is identical every  time  the  spreadsheet  is
 run.   BE  SURE  IN  USING  THESE FUNCTIONS THAT ALL ARGUMENTS ARE IN
 SPREADSHEET CELLS OR ACCUMULATORS.  LITERALS ARE NOT PERMITTED AS AR-
 GUMENTS.  Thus, a command like "SUM[A1:A5,5.5]" is illegal.  Instead,
 use a command like "A=5.5\SUM[A,A1:A5]" or "A=SUM[A1:A5]+5.5".  

      The  section on the interactive calculator (CALC) mode also men-
 tions the single argument functions available.  These include  normal
 trig  and  math functions like SQRT, SIN, COS, ATAN, AINT, ALOG, EXP,
 SINH, COSH, and some others.  These single argument functions may  be
 used  in  normal infix notation expressions, and do not have restric-
 tions on the types of arguments permitted them.  See the  section  on
 Calc  mode below for the full list.  There are also a large number of
 functions that are syntactically commands, but which perform calcula-
 tions.  These are also described in the Calc section and include date
 and matrix arithmetic and some addressing arithmetic functions.  


AnalytiCalc Reference Manual                                Page 27a


                     Summary of Variable Addressing

      Variable names may be of several forms;  examples will  be given
 first to illustrate.  

      D5 - Cell is in column D, 5th row down.  (Col. 4, Row 5)

      D$5 - Cell is column D, 5th row down, but in  relocating  copies
 the column (D) is not altered (unless the global override is set).  

      D5$ - As above but the row is not alterable.  

      D$5$  -  As above but neither row nor column may be altered...an
 "absolute" reference.  

      P#4#7  - Cell addressed is 4 columns to the right of and 7  rows
 down from  the current cell.  (P#0#0 is the current cell).  These are
 computed  on  the  base  spreadsheet.  This form of addressing is not
 subject to relocation, ever.

      D#4#7 - Cell  addressed  is  the cell DISPLAYED 4 columns to the
 right of the current  one and 7 rows down.  Since the display map can
 be anything, this means the  actual  cell referenced can be anything,
 depending on  the  current  display.   This form of addressing is not
 subject to relocation, ever.

      P#%AB - Supposing accumulator A contains  4  and  accumulator  B
 contains 7, the cell referenced is 4 columns right of the current one
 and 7 rows down on the physical sheet.  

      D#%AB  -  Supposing accumulator A contains 4 and  accumulator  B
 contains 7, the cell referenced is 4 columns right of the current one
 and 7 rows down on the display.  

      P#_AB  - If accumulator A contains 4 and accumulator B  contains
 2, the cell addressed is D2 (4th column over, 2nd row).  

      P#$D3:C2:  - if cell D3 contains 4.0 and cell C2  contains  2.0,
 the cell addressed is D2 again. 


AnalytiCalc Reference Manual                                   Page 27


                            Variable Names

      A valid variable name might be H14 or N22 or A3, or the position
 independent forms P#n#m and D#n#m where n and m are offsets in Physi-
 cal or Display sheets from the current column and row.  A valid range
 is 2 variable names separated by colon (:).  Thus the range B2:B12 is
 valid  and  means  B2  through  B12  inclusive.  The range expression
 D#0#1:D#0#12 is also valid and means the cells on the  display  sheet
 in  the  same  column but 1 to 12 rows down from the current cell in-
 clusive.  (The displacements may be negative too, with - sign to  in-
 dicate  it,  as D#-3#2 for the display cell 3 columns left and 2 rows
 down from the current position.) The P# and  D#  forms  are  valuable
 since they work wherever you move them.  Other variables may be relo-
 cated when moved (renaming them to  correspond  to  their  new  loca-
 tions),  but  the P# and D# forms need never change and allow working
 with projections across the physical sheet in  various  ways.   There
 are a few restrictions with these forms.  They usually need to be en-
 closed in parentheses (e.g.  (P#3#5) rather than  P#3#5)  inside  ex-
 pressions.  For most purposes they do work interchangeably with other
 name schemes however, though the "normal" naming scheme is  generally
 easier to use.  Copying with relocation works with normal cell names,
 provided that the cursor is above and left of  cells  to  be  renamed
 (see  below).   The keypad copy command normally moves to A1 during a
 copy for this reason.  The D# forms do not always  work  in  the  ex-
 tended address areas of the sheet, depending on recalculation mode.  

      The special construction P#%ab or D#%ab allows relative address-
 ing relative to current physical or display location using  accumula-
 tors  named  a  or b (where a or b may be any accumulator name from A
 through Z but upper case is REQUIRED).  This computable relative  ad-
 dressing  affords  greater flexibility in command procedure construc-
 tion.  

      In Amiga AnalytiCalc,  the cell address form P#_cr is available.
 This address provides absolute  cell  addresses  using the numbers in
 the two accumulators c and r for the column and row of the cell to be
 accessed.    Since  accumulators  run  out    somewhat    quickly  in
 AnalytiCalc, an alternate addressing form is also  provided.  If cell
 Cn holds a column number and cell Rn  holds  a  row  number, the cell
 name P#$Cn:Rn:  will address the cell whose column is in Cn and whose
 row is in Rn.  Such addressing may be indirect  to  one  level  only;
 that  is,  the Cn and Rn may be any legal address  form  for  a  cell
 EXCEPT the P#$cell1:cell2:    form.    These  address  forms permit a
 degree of data driven  computation  unavailable  in other spreadsheet
 type programs.  

       If a formula contains the construction {VN (where VN is any cell
 name), the FORMULA for cell VN is inserted  into  the  formula  being
 evaluated at that point, when the cell value is to be computed.  This
 may be done several levels deep, but is stopped after 10 translations
 to  avoid  infinite loops due to circular references.  Some care must
 be used here since the final  translated  formula  must  fit  in  110
 characters and will be truncated if it gets too long.  This construct
 is useful where formulas are to be tested.  These cell names may  (in
 AnalytiCalc  versions  for 320K and over) be replaced by alphanumeric
 names of your choice;  this will be  discussed  below.   The  formula

AnalytiCalc Reference Manual                                   Page 28

 replacement  feature provides a handy inline macro capability permit-
 ting complex formulas to be entered more easily.  This feature may be
 used  with the P#%ab form of addressing to provide runtime addressing
 of formulas anywhere in the matrix.  It may also be  used  (with  the
 position  relative P## forms of cell names) to conserve storage where
 a long formula must be repeated many  times,  at  the  cost  of  some
 speed.  

      The  command  processor may use these inline macros in commands.
 If a command line contains 2 successive underscores (__) anywhere  in
 its  length, the underscores will be stripped out of the command line
 and the command line will be scanned  for  {Vn  forms.   If  any  are
 found,  they  will  be substituted for prior to interpretation of the
 command.  This will occur AFTER any console text is read  if  console
 text  is required by one of the %%% forms of command line.  This per-
 mits formula cells to be used as a convenient place to  store  inter-
 mediate  answers  in models being driven by command files.  It is not
 particularly useful from the console, but works, and may be  used  to
 reenter  a  formula without moving it explicitly if there is a reason
 to do so.  (ENTER __{Vn).  

      Since  it is sometimes useful to have mixed formulas which allow
 certain cell references to be  absolute  and  never  relocated,  with
 other  references  which are relocatable, cell names may be specified
 absolute.  If the character "$" (dollar sign)  is  placed  after  the
 letter,  the number, or both, parts of the variable name, the part of
 the variable name followed by the dollar sign is absolute.  Thus, the
 variable  AB30 is relocatable in both row and column.  Variable AB$30
 is relocatable in row only (the 30 is not followed by $), and the  AB
 column  will not be changed in any relocate.  Variable AB30$ is relo-
 catable in column, but the row 30 reference does not  change.   Vari-
 able  AB$30$ is totally absolute.  Note that these absolute variables
 are harder to move around even on adding or deleting  rows,  so  they
 should  be  used  with  care.  This relocation protection can be tem-
 porarily inhibited with the OV + command and reinstated with the OV -
 command.   This  will  allow  copy  of cells with relocation if it is
 needed, without laborious editing.  The program starts in OV -  mode.
 If  the  OV + mode is set, the program will remain in OV + mode until
 OV - is set up again.  The commands may be given  in  the  form  OV-,
 OV -, OV+, or OV +.  

                            Variable Ranges

      Variable  ranges  must lie in a single row or column.  Erroneous
 specifications are rejected and ignored generally.  For  versions  of
 AnalytiCalc  supporting  matrix  operations,  matrix  dimensions  are
 however given by specifying the upper left and lower right corners of
 the  matrices.   Thus the range A1:B2 is the 2 by 2 matrix containing
 cells A1, A2, B1, and B2.  For operations using full rectangular  re-
 gions,  support  is offered via auxiliary keypad commands which allow
 filling of large regions or moving data into them.  This is done  via
 command  files  automatically invoked, but the methods used are tran-
 sparent to the user.  Other operations  on  rectangular  regions  not
 confined  to  a  single row or column may easily be added in the same
 way.  The internal implementation permits copying rows to columns and
 vice  versa  as well as rows to rows and columns to columns;  this is
 why regions must be one or the other.  It is  expected  that  regions
 are  specified starting at top left and ending at bottom right.  This

AnalytiCalc Reference Manual                                   Page 29



 must be done;  regions will not be completely handled otherwise.   By
 using  in-cell  loops  for their innermost computations, these macros
 are quite quick in execution and offer few  disadvantages.   They  do
 however ask separately for the bounds of the areas being modified.  

                          Function Arguments

      Note  that  the  square  brackets  ([])  are  needed  to delimit
 arguments in multiple argument functions.  The results  are  left  in
 accumulator  % and in the cell.  The IF form will compare 2 variables
 and execute either the statement or the  else-statement  (which  must
 NOT be another IF).  The valid relations are:  
       .EQ.    Equal
       .NE.    Not Equal
       .GT.    Greater than (V1 greater than V2)
       .LT.    Less than (V1 less than V2)
       .GE.    Greater than or Equal to (V1 >= V2)
       .LE.    Less than or Equal to (V1 =< V2)
 and  must  appear  in  this  form.   (Note  that  your  formulas must
 generally be in upper case only;  text can be anything.) 

                            Unary Functions

      The  second  class of formulas permit fully general arguments of
 expressions, cells, and the like (and are evaluated AFTER  the  multi
 argument  functions  lexically).   These  are  more conventional, use
 parentheses, and include single argument functions like  SQRT,  ALOG,
 EXP, SIN, COS, AINT, ABS, ATAN, and so on.  See the built in interac-
 tive calculator mode manual section below for more detail.   However,
 they  may  use variable names as anywhere, not just single letter ac-
 cumulators.  Thus, SQRT(A5) is a valid number.  There is  a  function
 list in the documentation of Calc mode later in this manual.  

                    Accumulators (Scratch Storage)

      The single letter accumulators of Calc mode (letters A through Z
 and %) are available globally and may take  on  all  Calc  mode  data
 types  (see  the  description  of calc mode below) including multiple
 precision.  They are usable globally on  the  entire  sheet  and  may
 serve as arguments to command files or return cells for results.  In-
 side command files, Calc mode can perform any of its  usual  calcula-
 tions.   The  multi-argument functions listed above are not available
 there (though they can be simulated by enumerating cells), but every-
 thing else is.  The letter accumulators are available in all cases in
 addition to cells.  Of course, any unused cell may be used as an  ac-
 cumulator  too, but cells in the spreadsheet are at most 8 bytes long
 and cannot hold multiple precision arguments.  


AnalytiCalc Reference Manual                                   Page 30



      To  get,  e.g.,  the square root of the sum of several variables
 (in a row or column;  ranges may only be in rows or columns together)
 one might have a formula line like:  

 SUM[A1:A20,B4,F2,C5:C20,J3:M3]\SQRT(%) 

 which  computes  the sum of the 2 cells and 3 ranges and leaves it in
 %, then computes the square root of that and leaves it in  the  cell.
 The  formulas  to  Calc may be complex but MUST NOT be longer than 78
 characters.  Break up longer ones so they  can  be  fed  to  Calc  in
 smaller  chunks.   Notice  that  the expression given could have been
 written as SQRT(SUM[A1:A20,B4,F2,C5:C20,J3:M3]) but was broken up for
 tutorial purposes.  

                   Auxiliary Commands and Functions

      The  commands  of  CALC  mode  should  be examined carefully for
 usefulness.  You can enter programs into CALC mode which can be  used
 as  user-defined  functions  from  the sheet if need be.  See the do-
 cumentation about the Calc mode  (interactive  calculator)  for  full
 lists of functions and further information.  

      Several  commands  available  in  cell calculations which affect
 computation exist;  several will be described here as well as in  the
 section on calc mode (which describes single cell calculation facili-
 ties in addition to those described here).  

      It  should  be  noted  that  these  functions  start  with the *
 character which also starts comments in command files to AnalytiCalc.
 Because  of this, the "Enter-mostly" mode treats any text that starts
 with * as a  comment.   To  enter  a  FORMULA  beginning  with  an  *
 character in "Enter-mostly" mode, you must use the syntax 

      /EV formula 

 where  formula  might  be  something  like  "*U IDATE"  (without  the
 quotes), i.e., something that may start with  a  *  character.   This
 method  allows  the  formula to be entered correctly.  Notice this is
 the "Command-mostly" command  for  entering  a  formula.   It  ALWAYS
 works, regardless of the type of formula.  

      One of these is the *G command.  Its syntax is 

 *G V1,V2 

 which  has the effect of evaluating variables V1 and V2 as column and
 row numbers on the physical sheet and returning  the  physical  sheet
 variable addressed by those variables.  The ranges are clamped to fit
 on the sheet.  This  gives  indirect  addressing,  permitting  lookup
 tables  to  be  made  up  by  creating  the  index  you want and then

AnalytiCalc Reference Manual                                   Page 31



 accessing the addressed table  element.   Typically  the  *G  command
 would  be  the  last  on  a formula line, though it need not be.  Its
 value is returned in the % accumulator.  

      Another  is  the  *W command, which simply takes the number in %
 and places it in the formula for  the  current  cell  on  the  spread
 sheet.   This may be used to "freeze" a value, replacing a formula by
 a constant for future use.  Note that the previous  contents  of  the
 formula  entry  are  lost.  Thus, a *W command in the sheet will nor-
 mally cause itself to be overwritten after one use.   The  number  is
 stored in a format D35.24 in the worksheet.  

      To  implement  user functions, if Calc sees an expression of the
 form "*@filename.ext", it will execute that file as a command at that
 cell.   Any filename may be used and as many functions as desired can
 be handled in this way (with obvious overhead), with nesting depth of
 up  to  3  permitted.   These command files correspond to "macros" in
 other spreadsheets, and exist outside the sheet, so  a  command  file
 can be used by many worksheets.  

      AnalytiCalc  has also a command called *P which allows resetting
 of the physical coordinates while executing a  cell's  formulas,  FOR
 THE  DURATION  OF  THAT  CELL'S FORMULA ONLY or while in K mode (calc
 mode) only.  

      The  syntax  of  the  *P command is either just *P (which causes
 AnalytiCalc to prompt for column and row), or *P Variablename  (which
 moves   the   current   location  to  the  named  location),  or  *P@
 variable1,variable2 (which moves to the location which is defined  by
 variable 1 and 2 as col.  and row).  

      There  are  several  other useful calculation commands, a few of
 which are summarized here.  

      The command *F LABEL 
 will  evaluate  the  % variable.  If it is positive and nonzero, then
 the  current  input  line  will  be  rewound  and  the  program  will
 (silently)  seek a line of the form *CLABEL.  This allows loops to be
 defined with % as the counter.  This command acts on the unit used by
 the  AnalytiCalc @ command, NOT the unit for the Calc *@ command, and
 is a way that the Calc formula conditionals  may  be  reflected  back
 into  its  command  processing.   The TE expression command should be
 used first to set the % variable as needed to any arithmetic  expres-
 sion to control the loop.  

      The command *J LABEL 
 will  act as does *F LABEL but its search will be in the current file
 opened by a Calc *@ command (i.e., an *@file inside  a  cell  on  the
 sheet,  or  given  from  the console after a K command [see below] to
 enter bare interactive Calc).  

AnalytiCalc Reference Manual                                   Page 32



      The command *QF or *QW file ?searchkey?  <cc> 
 ("Query  Float" for getting a real ("floating point") number into the
 sheet from a file, or "Query Write" to write part of a file into  the
 sheet)  will  open file and look for lines starting with searchkey as
 given (with _ as a wild character).  Upon finding this, it will  look
 for  the <cc> and if it finds it, it will select the part of the line
 in the file between the 2 characters given (which may  be  alike)  as
 they  are  first  found, and will do one of 2 things.  If the command
 was *QF, then Calc will Float the value found  there  (attempting  to
 use  a  large  D format) and return it in %.  If the command was *QW,
 then Calc will Write the selected part of the record into the formula
 at  the current physical position on the sheet (which may be reset by
 an IMMEDIATELY PRECEDING *P command).  The  record  may  contain  the
 search  key anywhere.  It is up to the user to make sure the formulas
 copied make sense.  This however allows access to sequential files of
 data  which  can  be  created by an editor, word processor, etc., and
 which might hold keyed information that  the  spreadsheet  should  be
 able to manipulate.  As a user convenience, there may be a second key
 specified (also inside a pair of ?s).  If  two  keys  are  specified,
 Calc will search for and require that BOTH be somewhere in the record
 accepted.  Note too that the files opened may not  have  any  records
 longer  than 128 characters per line.  There are 2 variant forms, in-
 volving the 4th character (i.e., the next one after the F or W of *QF
 or  *QW).   These  may  permit sequential access to a data file.  The
 *QFK command is exactly like the *QF command (ditto *QWK and *QW) BUT
 it will not close the data file after finding the desired cell unless
 it reached EOF.  This permits subsequent commands of the *QFN command
 (for  "Next")  to  continue  reading the file.  The *QFN command will
 continue reading the file (the file spec must be  there  but  is  ig-
 nored) from the next record and will also not close the file.  (Ditto
 *QWN.) The *QFC command will act exactly as *QFN BUT will  close  the
 file  when  the request completes.  Thus, a file may be opened with a
 *QFK (or *QWK) command, subsequent data retrieved by  *QFN  commands,
 and  finally  the last data retrieved with a *QFC command.  Also, *QF
 commands will close the file prior to opening another.   The  command
 mnemonics here may be read as Query File [Next/Close/Keepopen].  

      Formulas entered may have the following constructs which will be
 edited into the formula as entered  (so  a  command  file  can  enter
 them):  

          _@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

AnalytiCalc Reference Manual                                   Page 33



               function to allow retrieval and edit of formulas.   The
               *U XQTCM  function  permits use of the EDit command (as
               well as others) within a cell for string  manipulation.
               Only  8  characters  at  a time may be represented (the
               limit imposed by cell size), but  repeated  use  allows
               handling  any  desired length.  An application would be
               setting the cell used as V1 to a packed  representation
               of either of two strings inside an IF [] and then EDit-
               ing the string into the formula as desired where one of
               the  2 strings should be made to appear.  This capabil-
               ity is crude but provides the bare bones functionality.
               Additional  USRFCT calls to give simpler (but more ver-
               bose) string manipulations are  not  too  hard  to  add
               should the user need them.  

                            Formula Length

      Formulas have 109 characters allotted to them for use inside the
 spread sheet.  It may happen these are not enough for use.  In  other
 spreadsheets, the technique is to put the formulas in other cells in-
 side the sheet and possibly use screen windows to  avoid  display  of
 the intermediate results.  

      While  you can use that technique here too, you have an alterna-
 tive.  It is to use an indirect file in that cell and inside the cell
 in the spreadsheet just have a command "*@FILE.TYP" where the file is
 named "FILE.TYP" (you pick the real name).  Inside this file  may  be
 whatever calculations you like.  

      So  long  as  the file is to operate in a fixed cell location in
 your spreadsheet, you may use variable names like A3, D1,  etc.   in-
 side  the file.  Your command files may include any multiple argument
 functions except the IF function.  (The *F and *J  functions  can  be
 used   to  provide  equivalent  functionality  inside  command  files
 however.) The only restriction on multiple argument functions is that
 their arguments must be cells, not general expressions.  

      Once  you  add  or  delete  rows  or columns, or copy a formula,
 though, the file may not work as expected if the cell calling it  has
 moved.   Since  the  relocation  done by AnalytiCalc only operates on
 formulas stored directly in the spreadsheet, it cannot relocate vari-
 ables  in the indirect files.  However, you can make the files "posi-
 tion independent" so they WILL work wherever they  are  called  from.
 (This has the side benefit that a single file can be called from many
 cells.) 

      The  way  to  make  the  files  position  independent  is to use
 location-relative variable names instead of absolute ones.  That  is,
 inside  cell  B4,  the  cell  immediately  above can be named B3 (the
 ABSOLUTE name), or it can be relocatably named P#0#-1  (the  relative

AnalytiCalc Reference Manual                                   Page 34



 name).   Likewise  the cell one to the right would be named either C3
 or P#1#0, and so on.  The cell two down and one left would be  either
 A5  or  P#-1#2 (you can begin to see how it goes).  A file containing
 only location-relative variable names will work even if called from a
 different  cell,  since the references will be figured out when used.
 These references are more difficult to write than the absolute  ones,
 but  since they work without renaming, they provide a level of flexi-
 bility needed where long formulas must be used.  These  forms  should
 be  used wherever indirect files are used to hold cell formulas.  The
 computed cell name forms like P#%ab can be used also provided  the  a
 and b accumulators are initialized properly, or the command file does
 its own relocation using the X and Y accumulators set on entry.  

      By using command files, it is possible to add your own functions
 to the spreadsheet.  Just devise a command  file  that  performs  the
 arithmetic  and addressing you need and use *@file.typ where you want
 to evaluate the function.  Arguments can be  passed  in  accumulators
 and  P## or D## forms can be used for cell addressing (note that it's
 P#col#row and D#col#row).  The *U HERE function can be used to return
 the current location in two accumulators to allow address arithmetic. 

                        Linking Multiple Sheets

      To  enhance  AnalytiCalc, it is possible to have a cell refer to
 cells from another, saved sheet anywhere in the  system.   The  sheet
 must  normally  have  been  saved NUMERICALLY (see PPN command below)
 starting at the upper left (i.e., cell A1) as would be the convention
 for using with ACGRAF, the associated graphics output utility.  

      The command *XV filename V1 
 will  eXtract  the  Value  of  cell V1 (V1 is any variable name, e.g.
 C15, AA3, F9, B34, etc.) from the saved sheet saved in filename.  The
 filename  is  any  legal host system file specifier.  Note that there
 may be as many files as desired here, but only one cell is returned. 

      If  it  is desired to extract a formula from a saved sheet saved
 NON-NUMERICALLY, the command form is 
 *XF filename V1 
 and  this will cause the formula in "filename"'s cell V1 to overwrite
 the current physical sheet.  To avoid this, one might write a formula
 like 

 *P V2 \*XF myfile.typ V1 

 which  would  cause  current  sheet  variable V2 to have its' formula
 loaded from saved sheet "myfile.typ"'s variable V1.   Note  too  that
 the GPR or GDR commands will load saved sheets onto the current sheet
 (starting at the cursor) with all formulas relocated, so that  entire
 saved  sheets  can  be merged quickly where the one by one operations
 just described would be too slow.  

AnalytiCalc Reference Manual                                   Page 35



      In  general, save your sheets symbolically (non-numerically) for
 archival purposes;  save numerically for post processing or  handling
 of  data  by  "master"  sheets or for graphics.  You may want to edit
 AUXKPD.TXT so that F4 saves the entire sheet  both  symbolically  and
 numerically  if you frequently do both and want the two to be in syn-
 chronism.  The default save, PPX, now saves both numbers  and  values
 so it is normally all that is needed.  


           Loading Non-AnalytiCalc text files onto the Sheet
 
       FILE LOADING
 
   F filename/nnnn      Read filename, skipping nnnn lines
                     if the "/nnnn" is there, and load
                     contents onto the currently displayed
                     screen, broken into columns as the
                     current screen is set up.

      This  command is designed to make it easy to load document files
 into AnalytiCalc in quasi-image mode.  Once  loaded,  the  characters
 are  in formula cells and may be moved around the sheet.  The display
 format must be reset to get them to be  treated  as  non-text;   this
 command  will  reset  all  loaded  cells  to text format display.  It
 repaints the screen upon loading.  This feature makes it easy to cap-
 ture data in AnalytiCalc from other unrelated programs.  You can com-
 pute with cells that are loaded in this way but contain valid numeric
 data  by  changing them to numeric cells by the DF range [*] command.
 If you need to add decimals to the end of  the  cells'  numbers,  the
 ED //./  command  will  add  a decimal to the end of a number and the
 ED / // command can be used to get rid of extra space characters in a
 formula.  



AnalytiCalc Reference Manual                                   Page 36



                  Getting Saved Sheet Data from Files
 
       RESTORING YOUR SPREADSHEET
 
     GD          Reload sheet down/right onto display
                 coordinates.
     GP          Reload sheet down/right onto physical
                 coordinates.
     GB          Reload sheet like GP but from sheet saved
                 in binary mode with PB command.
     GPR         Reload sheet onto physical coords and Relocate
                 formulas as if the saved A1 cell were moved
                 to the current cursor.
     GDR         Similar to GPR but on display coordinates.
     Gxx+        Add saved sheet (if default save) values
                 to current values; enters Recalc Manual mode.
     Gxx-        Subtract saved sheet (if default save) values
                 from current values. Also enters Recalc Manual
                 mode. "xx" can be PR,BR, PX, etc.
 

      The  GP/GD  commands  are  the inverse of the PP/PD commands and
 load those files to potentially new locations.  This  is  the  simple
 way  to  merge  sheets.  In these cases, you are separately asked for
 filenames and limits on what part of the sheets to  load/save.   Only
 cells  that  are  marked in use are saved, so sparse sheets take less
 space than saving the direct access files.  Note that on save or  re-
 store  the  ranges  to  restore  are asked for.  To restore the sheet
 starting at the cursor, specify the lowest row/column offset of 1 and
 the  highest either 0 or a very large number.  Any rectangular region
 can be restored by giving the X and Y coordinates of the  lowest  and
 highest  offsets from the upper left to restore, counting from 1.  If
 the P or D is omitted from the GPx or GDx commands (where x is either
 R  or  anything  else),  the action will be determined by whether the
 sheet was saved by a PP or by a  PDx  command.   REMEMBER:   THE  LOW
 OFFSET SHOULD BE 1 OR LARGER, NOT 0.  

      The GB  commands  restore spreadsheets that have been saved with
 the PB commands.   The save formats of the PP and PB commands are NOT
 compatible, so sheets saved  with  PB must be loaded with GB.  The *X
 and graphics routines assume the  PP  form  save,  but the PB form is
 faster.  Spreadsheets saved with PB  cannot  safely be transported to
 other machines, either.  Spreadsheets saved with PP can be moved from
 any AnalytiCalc to any other.  GB commands take the same modifiers as
 GP commands do.

       The  GPR  or  GDR commands relocate a saved sheet to a new loca-
 tion.  If for example a sheet is saved from A1 on down and right,  if
 it  is  loaded into another sheet when the cursor is at another cell,
 all formulas are relocated on load so that they are correct  for  the
 new  location.   (This follows the normal relocation control rules so
 that the $ forms of names may inhibit relocation.) The intent of this
 is that it makes it trivial to merge multiple sheets and make summary
 sheets.  

      In  AnalytiCalc/Amiga,  the  logic  to  write  to cells involves
 checks of the built in symbol table to ensure that cells are not pre-
 viously  there and needing to be replaced.  This slows the Get opera-
 tion considerably, and is normally bypassed.  However, where a  saved
 sheet  is  being merged into an existing sheet (rather than restoring
 into a previously empty region of the sheet), the full logic  may  be

AnalytiCalc Reference Manual                                   Page 37



 needed for correct operation.  To get it, enter the filename followed
 by "/M" (so that to read SAVESHEET.PCC in the  full-update  mode  you
 reply  SAVESHEET.PCC/M  to  the "Enter Filename>" prompt, rather than
 just SAVESHEET.PCC, as an example.) (M stands for Merge.) 

      The  +  or - modifiers in the 4th character of the command allow
 you to add or subtract multiple saved sheet  values.   These  require
 that the normal default save (which includes both numeric and formula
 data) have been done to save the sheets being added.  The  values  in
 the sheet have the saved values either added (if +) or subtracted (if
 -) from the current values.  The manual recalculation flag is set  to
 prevent  any automatic recalculations also, since formulas are loaded
 from the last sheet loaded and overwrite other formulas in  the  same
 cells.  (This is generally not a problem.) To manipulate these values
 if there is a need to, the TEst command and the matrix math functions
 (which  include  multiply  matrix  by constant) allow two dimensional
 areas to be moved around or multiplied by constants  without  turning
 on  the  sheet recalculation.  Thus, averaging 4 sheets could be done
 by a GP command, three GPx+ commands, and then  a  TE  using  the  *U
 MMPYC function to multiply the whole area by 0.25.  (One could use TE
 A=0.25 to get a "cell" A0 to use in the MMPYC  function  if  no  0.25
 value existed to use already.) 


                      The AnalytiCalc HELP System
 
         HELP
 
      Hn     Display a screen of help. (n from 0 thru 9)

      The  H command will display a screenful of help giving a summary
 of many AnalytiCalc commands and syntax options.   When  you  type  a
 second return, it will redraw the screen.  

      The F1 key also means 'Help', and the ALT-F1 key draws a diagram
 of the function key assignments.  Control F1 will  draw  a  one  line
 reminder HELP message on line 25.  

      There are multiple help pages.  They are selected by commands H0
 through H99, the number defaulting to  0  and  selecting  which  help
 screen will appear.  

      The PCCHELP.HLP file must be in the default directory  for  this
 to work correctly on Amiga currently. 


AnalytiCalc Reference Manual                                   Page 38



                  MOVING TO LOCATION (GOTO anywhere)
 
       LOCATE CURSOR (GOTO somewhere on the sheet)
 
    L variable-name    Position cursor at variable-name
 

      The  L  command moves the current position to the variable named
 on the Physical sheet (and the display sheet if the  variable  is  on
 the display).  Examples might be SKIP 1 
     L B3    Move to cell B3 
     L D6    Move to cell D6 


       Setting Direction for Motion after Entering Cell Contents
 
       MOTION DIRECTION (Set Default
       Direction to move after an Enter)
 
     THIS COMMAND SETS DIRECTIONS FOR AUTOMATIC
          MOTION AFTER ENTER ONLY.
     SEE BELOW FOR HOW TO MOVE THE CURSOR AT
          OTHER TIMES.
 
       M0           (Restore last auto move direction)
       M1           (Move up)
       M2           (Move down)
       M3           (Move left)
       M4           (Move right)
       M5           (No auto motion)
 

      The  M command causes automatic cursor motion after an E command
 in the direction indicated.  This only occurs  after  an  E  command.
 The  default  condition is not to move at all after an E command, and
 this may be reestablished by a command of form M5 (actually Mc, where
 c  is  any  character other than 1 to 4.) The M0 command restores the
 last automatic motion direction and saves the current one as the  new
 last  direction.   This  is useful where a command procedure needs to
 turn off auto motion but wants to turn it back  on  at  the  end;   a
 dummy EDit may be used if a single motion is needed.  



AnalytiCalc Reference Manual                                   Page 39



                 Including Multiple Files into Reports
 
       MS   Macrocell Show (handles &% and &&% files)
       MH   Macrocell Hide (no special & treatment)
       &%file,nskip,nshow    overlay file on screen
       &&%file,snskip,nshow  Include file for output

      The MS and MH commands turn on or off the handling as print time
 macros of the &% and &&% forms of filenames.  These permit you to use
 AnalytiCalc  for  report  generation or outline handling more easily.
 In MS mode, if a cell has an &%file form in it,  that  file  is  read
 when  that  cell is displayed.  The first "nskip" records are skipped
 in the file, and up to "nshow" lines of the  file  are  displayed  on
 null  cells  of the spreadsheet.  Up to 4 files may be open at a time
 here.  The left margin of the file text is made to coincide with  the
 location  of  the  cell  containing the reference.  You can use the $
 (spawn) command to edit these files with your favorite editor or word
 processor  on  the  system  and they will automatically be updated on
 screen.  The &&% form is used to include (possibly lengthy) files  in
 output.   The  files  are included in spreadsheet output at the point
 they are seen, indented by the amount of the  indenting  of  the  &&%
 command  form.  Therefore, you can use AnalytiCalc to organize a mul-
 tilevel hierarchy of printout of reports.  If a &&% form is  seen  in
 one  of  the  files being included, that file is opened and included.
 This nesting may go to a depth of 4  levels.   This  permits  a  real
 "frame  editing"  using  AnalytiCalc and your favorite editor or word
 processor (WITHOUT requiring you to learn yet another editor.) 

      In  general,  AnalytiCalc  is  not  supplied with a text editor.
 Most people will already have one and it was thought a waste of  time
 to  ask  anyone  to learn another.  Rather, the program allows you to
 use whatever editor you like (via the $ or } commands  to  exec  your
 own  editor) even under the sheet.  What is added is rather the abil-
 ity to ORGANIZE documents flexibly and  easily.   AnalytiCalc  graphs
 also are written in a format that permits this treatment.  



AnalytiCalc Reference Manual                                   Page 40



                   Resetting Displayed Part of Sheet
                       (Windowing and Scrolling)
 
         ORIGIN RESET  (Windows onto physical sheet)
 
     OA variable   Reset origin of display to variable
     OR variable   Reset display down and right to start
                       with variable
     OAD variable   Reset origin of display to variable
                       leaving windows intact.
     ORD variable   Reset display down and right to start
                       with variable leaving windows
                       intact.
 

      The  OA and OR commands let you do quick scrolls around the phy-
 sical sheet by resetting the upper left corner of the  display  sheet
 to point at any variable on the physical one and make the rest follow
 suit (OA), or will reset the display sheet starting at  your  current
 cursor  location to point at the physical sheet variable and make all
 parts of the displayed sheet down and right from your  current  loca-
 tion correspond likewise.  

      Thus, if you start with a normal initial display and execute the
 commands 

     L C1 
     OR H1 

 you wind up with columns A and B still on screen, but now the remain-
 ing columns are H, I, J, K, L instead of C, D, E,  F,  and  G.   This
 happened  because cell H1, down and right were pointed to by the dis-
 play sheet starting where you were, which was cell C1, initially  the
 3rd column and first row.  Had the command been OA H1, the column la-
 bels would be H-N rather than the initial A-G.  

      If  the  OAD  or ORD forms are used, the area remapped is simply
 moved by the offset between the  old  origin  of  the  region  you're
 remapping  and  the  new origin, so windows stay relatively placed as
 they were.  Scrolling now uses OAD and ORD forms so windows stay  in-
 tact.  

      The  difference  between OA, OAD, OR, and ORD may be illustrated
 in the following figures, which represent the screen mapping after  a
 command sequence 

AnalytiCalc Reference Manual                                   Page 41



    OA A1
    L C1
    OR AA1
    L A11
    OR A100

 which  produces  a  screen mapping like this:  (note only part of the
 map is reproduced...) 

          A       B       AA       AB      AC
    1>   A1      B1      AA1      AB1     AC1
    2>   A2      B2      AA2      AB2     AC2
    3>   .       .       .        .       .
    4>   .       .       .        .       .
    5>   .       .       .        .       .
    6>
    7>
    8>
    9>
   10>  A10     B10    AA10      AB10     AC10
  100> A100    B100    C100      D100     E100
  101> A101    B101    C101      D101     E101
  102>
  103>
  104>        and so forth. Note that columns
  105>           AA, AB, and AC are now mapped
  106>           for only 10 rows. Thus we have
  107>           3 screen regions, not 4.
 

 While after a sequence like:  

AnalytiCalc Reference Manual                                   Page 42



    OA A1
    L C1
    OR AA1
    L A11
    ORD A100

 the resulting screen mapping looks more like this:  

          A       B       AA       AB      AC
    1>   A1      B1      AA1      AB1     AC1
    2>   A2      B2      AA2      AB2     AC2
    3>   .       .       .        .       .
    4>   .       .       .        .       .
    5>   .       .       .        .       .
    6>
    7>
    8>
    9>
   10>  A10     B10    AA10      AB10     AC10
  100> A100    B100   AA100     AB100    AC100
  101> A101    B101   AA101     AB101    AC101
  102>
  103>
  104>        and so forth. Note that columns
  105>           AA, AB, and AC now extend to
  106>           the full screen. This gives
  107>           4 screen regions.
 


      These  figures illustrate the usefulness of the OAD and ORD com-
 mands.  



AnalytiCalc Reference Manual                                   Page 43



                         Putting Data to Files
 
         SAVING YOUR SPREADSHEET
 
     PD        Put out current Display sheet (Formulas)
     PP        Put out current Physical sheet (Formulas)
     PDN       Put out current Display sheet (Numbers)
     PPN       Put out current Physical sheet (Numbers)
     PB        Save spreadsheet in Binary form
     PxxM      Put out display to physical map as well as
               worksheet information. Saves displayed mapping
               only.
     PxxMA     Put out display to physical map. Saves entire
               mapping, whether within DB command bounds or
               not.
     S         Startup questions. Allows global width
               and format settings and new title entry.


      The  S  command will lead to questions being asked about whether
 to update the display mapping.  If you reply Y, you will be  able  to
 reset the default display column width to whatever you like between 1
 and 120 characters and to say whether to reset the display  sheet  to
 point to the upper left of the physical spreadsheet.  In any case you
 will be able to reset the default format and the  spreadsheet  title.
 In AnalytiCalc-Amiga, this is all the S command does.  

      The  PD  and  PP  commands write Display or Physical sheet cells
 that are active to a specially formatted sequential ASCII text  file,
 always  starting  from  the current position of the cursor and saving
 right and down.  Some questions will be asked so you may enter a max-
 imum displacement to save (so not all of a large sheet need be saved)
 in columns and rows.  On reload (the GP/GD commands), these questions
 are also asked, and minimum displacements are asked also to allow you
 to enter basically any region of the saved sheets  into  the  current
 sheet  starting  at  the  current location and moving down and right.
 This gives a large scale move capability and a sheet  merge  capabil-
 ity.  

      The  PPN  and  PDN  commands  save numbers instead of formats to
 permit loading of isolated numeric values from other sheets by  using
 the GD or GP commands (below).  They record only numbers and not for-
 mulas, but this allows any cell's numeric value from other sheets  to
 be loaded into another sheet without loading all formulas and repeat-
 ing calculations.  Also, the PPN/PDN commands are needed to  use  the
 ACGRAF  program  to  graph parts of a sheet if this form of output is
 desired.  

      The  PP/PD  commands are suitable for archival storage of spread
 sheet data, or for its transportation to  differently  compiled  ver-
 sions of AnalytiCalc.  

      The PB command works like  PP  EXCEPT that it stores in "binary"
 form.  This is considerably faster  than  PP  but not as general.  In
 particular the GB command must be used  to reload the sheets so saved
 and the *X class commands cannot use binary  sheet data;  nor can the
 supplied graphics routines.
 
      The final M or MA qualifiers allow you to  save  the display map
 for the sheet in addition to the data and formulae.    Where your map
 is  nontrivial  this  is a good idea, though it consumes considerable
 disk space and its' use must be considered on a case by case basis. 


AnalytiCalc Reference Manual                                   Page 44



                         Recalculation Control
 
       RECALCULATE
   R    Recalculate all of the sheet.
   RM   Recalculate manually only until R command given
   RE   Recalculate Entries as made but nothing else until
          R command given.
   RI   Recalculate Incremental - Calculate displayed cells only.
   RM   Recalculate manually only until R command given
   RAF  Recalculate sheet, without constant recalculation
   RF   Recalculate, Force constant recalculation.
   RR   Recalculate, Force, but stay in RE or RI mode if in
          it already.
 

      The  R  command  forces a recalculation of the sheet.  This will
 evaluate all formulas on the sheet and update the display to show the
 new  numbers.   Normally,  recalculation is done after each number is
 entered to update the new cell, but the RF command forces  total  re-
 calculation  in  case anything was missed.  The standard keypad's Re-
 calculate key generates the RAF command  automatically  for  ease  of
 use.  

      Since these calculations can be time-consuming, you can suppress
 them while doing  input  by  entering  the  RM  command  (Recalculate
 Manually)  which  suppresses  recalculation until an R command is en-
 tered.  This command's format is just 

 RM 


      For  further speedups, AnalytiCalc can be put into RE or RI mode
 to recompute only the cells just entered after each entry, or to com-
 pute  cells  on  the  display only.  It starts in RI (Recalculate In-
 cremental) mode until an R command  is  given.   After  an  R  or  RF
 command  is given, AnalytiCalc goes into a mode where it will compute
 ALL cells that have anything in them  at  each  sheet  recomputation.
 Another  RI  or  RE command will return to the previous mode.  The RR
 command does a RF (Recalculate,  Force  constant  recomputation)  but
 stays  in Incremental or Entry mode.  Whenever a new sheet is loaded,
 a single R is done automatically regardless of the current mode.  

      To  speed  normal  recalculation, AnalytiCalc only computes con-
 stants once.  The normal RF command will force them to be  recomputed
 also.   AnalytiCalc  normally  will  keep  track  of  the  lowest and
 furthest right cells in use and only ever try to recompute cells that
 have active values there.  



AnalytiCalc Reference Manual                                   Page 45



                      Setting Relocation Boundary
 
      RELOCATE BOUNDARY
 
         RB*     Set maximum row and col for relocation
                 to end of sheet
         RB Var  Set maximum row and col to be relocated
                 to coords of Var (cell name)

      The  RB command affords a way to specify a lower right corner to
 the area relocated by any of the copy and relocate operations.  Below
 or  to the right of the relocation boundary, moves are all treated as
 absolute even if specified as relative.   Therefore  the  area  below
 this boundary will not be relocated by the AR commands or the CR com-
 mands.  This allows the AR operation to relocate only a  finite  max-
 imum  number  of  rows  or columns, or permits cells moved beyond the
 boundary specified to be unrelocated.  The upper left corner  of  the
 relocation  area  is  defined by the cursor position, so this permits
 any rectangular area to be moved without relocation while the rest is
 relocated.   Combination  of this feature with the AR and CR commands
 permits moving rows or columns (or parts of them) via command  files.
 This moving would generally be done with the IR command to relocate a
 region in place to be moved to another site, then actually copying it
 (absolutely) to the desired destination.  Alternatively, the AR/AA/CR
 commands can be used to move things around.  For example, a rectangle
 could  be  moved away from the origin further by using the cursor and
 the RB command to delimit the area to move, then using a command file
 to  cycle  through  a  set  of CR commands to copy all cells down the
 desired amount.  The AA command could then be used to delete the  un-
 desired top cells and the area to be moved now moved into its new ad-
 dress, all other cells having been relocated.  The  functionality  of
 moving  cells is however much better served on AnalytiCalc by the OA,
 OR, and DL commands to reset the display mapping (possibly while log-
 ging  keystrokes  so  the mapping can be easily reproduced) to effect
 the desired move.  For simply reformatting  the  screen,  DL  affords
 control  at  the level of any regions desired.  A command file should
 be devised for moving cells but only used when really  needed  badly,
 if  such  actions  are  needed for other reasons.  There will be very
 little need for them under most circumstances however.   Where  cells
 must  move  closer  to the origin, an AR command at the origin can be
 used to provide temporary space in which to move the cells;   at  the
 end,  they will be moved back further.  The IR command (Inplace Relo-
 cate) can be used to  avoid  major  moving  around  the  sheet.   The
 *U HERE  function will return the current max column in accumulator W
 and the current max row in accumulator Y to facilitate  this.   These
 maxima  can  be  used to write an efficient command file to copy only
 the areas in use.  Internal loops in a formula  (with  the  *U  XQTCM
 function) are the fastest way to implement such a loop.  



AnalytiCalc Reference Manual                                   Page 46



                        TEST expression command
 
       TEST
 
      TE expression    Evaluate expression, save in %
 

      The  TEst  command allows command level calculations, for use in
 controlling loops.  It evaluates the expression (up to 79  characters
 long)  and  stores in the % accumulator.  Useful for *J type commands
 to control branching in AnalytiCalc.  Any expression may  be  handled
 in  a  TE  command,  and  forms of the sort Z=expression are allowed.
 NOTE however that it is frequently desirable from  command  files  to
 add a C to the end of the formula since sometimes junk from preceding
 lines is not zeroed.  The \*C causes it to be treated  as  a  comment
 and ignored.  

      The  TEst command will calculate formulas even in restricted re-
 calculation modes (RM mode, RE mode, or  RI  mode)  since  it  ALWAYS
 evaluates the expression regardless of mode.  The construct to evalu-
 ate a cell with a command like 

      TE V1=__{V1 

 (which sets a cell value to the computed value of its formula) is ex-
 plicitly legal and can be used where it is desired to perform irregu-
 lar partial recomputations while in RM mode.  


                          VIEWSCREEN Control
 
         VIEWSCREEN UPDATE
 
      V           Redraw screen with normal formats
      VF          Redraw screen showing all formulas
      VM          Don't redraw screen until a V or VF is
                          given.
 

      The V and VF commands redraw the display screen showing numerics
 as numerics in the selected format (V) or displaying whatever part of
 the  formulas  fits  on  screen  in  the  column  (VF).  This is used
 wherever the picture on the screen is  damaged,  e.g.,  by  operating
 system  broadcasts.   VM  is  used  to  inhibit redraw while numerous
 changes may be made, to save time.  A V or VF command will re  enable
 display updates.  



AnalytiCalc Reference Manual                                   Page 47



                   Writing ASCII images of Displays
 
         WRITING SCREEN TO HARDCOPY OR FILES
 
         W     Write screen to file

      The W command lets you write a hard copy of the screen as it ex-
 ists on display to a file.  AnalytiCalc will prompt you for the  file
 name;  the device specifier should be included.  

      Note that if the filename you enter (or the last character after
 the device or file specifier) is a "/"  character,  AnalytiCalc  will
 omit the column and row labels in the output file or printout so that
 you need not edit them out afterwards.  They will always be displayed
 on the screen however.  

      To  output  to  the  lineprinter,  the file specifier to give is
 PRT:.  The output file in any case has no  strange  escape  sequences
 and  may be edited with any normal system editor.  To junk any output
 you don't want, use a filename of NIL and to go to a generic  printer
 you  may  use a filename of PRT.  If the character "%" appears in the
 file specifier, the title will not be displayed on printout.  This is
 designed  to  help  those  producing  paste-together  printouts  from
 several sheet areas.  


                             EXIT command
 
         EXIT
 
   X           Exit to operating system.
 

      The  X  command  exits from AnalytiCalc to the operating system.
 In general, this is the ONLY way (short of an abort  command  to  the
 operating  system)  to get out of AnalytiCalc, and is the ONLY WAY TO
 LEAVE GRACEFULLY.  You should use the PP or PD command to  save  your
 sheet  prior to XD if you want to save your sheet;  otherwise it will
 be lost.  Be at least that cautious;  the program will NOT keep track
 of  whether  you've saved the sheet or not.  Please note and use this
 exit method;  it allows AnalytiCalc to clean up  and  close  windows,
 which otherwise may not be done.  



AnalytiCalc Reference Manual                                   Page 48



                             ZEROing cells
         ZERO VARIABLES
 
    ZA           Zero whole sheet
    ZE V1:V2     Zero variables in a row or column
                 in range from cell V1 to cell V2
                 (V1,V2 = names of cells)
 

      The  ZEro  commands clear out a sheet.  The ZA command will also
 ask if you mean it and needs a reply of Yes to actually  clobber  the
 whole sheet and return it to pristine purity.  

      The ZA command occasionally takes a noticeable time to clear the
 workfiles out;  do not be alarmed at this.  It  will  ask  afterwards
 for a new title, new display format default for floating point, etc. 

      If  you give the ZA command, AnalytiCalc will ask you to confirm
 that you indeed want to zero the entire sheet.  A  reply  of  Y  will
 proceed  to  execute  the  command;   any  other reply will abort the
 clearing operation.  


                        TEXT SEARCH OF FORMULAS
    SEARCH for formula substring
 
     >STRING      Find cell whose formula contains STRING
     >>STRING     Find cell whose formula starts with
                     STRING
 

      The  >  command  (greater  than sign) causes a search to be made
 from the current position down and right to the relocate boundary for
 a  formula  containing  the  string after the >.  The cell found (the
 first one) will become the current cell.  The origin  is  not  moved,
 but  the command OA P## will cause the cell found to become the upper
 left cell on the screen if desired.  This is a handy tool for  locat-
 ing sections of a large sheet.  The comparison is between the entered
 string and the formula, but terminates with the shorter.   Therefore,
 aliasing  occasionally occurs.  Just skip past the offending cell and
 redo to continue to search.  The >>STRING form anchors the search  at
 the  start  of  the  string so this will not occur, though very short
 formulas whose beginnings match the search string  will  match.   The
 underscore   character  (_)  is  a  wildcard  character  for  formula
 searches.  



AnalytiCalc Reference Manual                                   Page 49



                Driving AnalytiCalc from Command Files
 
      EXECUTING COMMAND FILES
 
    @filespec    Read filespec and execute commands
                 as though typed in.
 
 The @ command lets you treat a file as though it  were  your  console
 input  (returns on endfile) to let you execute saved sets of commands
 to set up your sheets.  Note that if you issue the K command (below),
 those inputs come from a separate file on logical unit 1.  

                   Recording Commands Interactively
 
         JOURNALING
 
   +J filename   Opens filename as a journal file,
                 recording commands to that file.
                 (Note: auxiliary inputs are not so
                 recorded, where asked for as separate
                 questions.)
   +N            Closes any open journal file
 

      The  journaling commands allow typed commands to be saved into a
 file later usable as an indirect command input to AnalytiCalc to  al-
 low  recreation  of screen formats, data, formulas, etc.  Extra ques-
 tions (e.g.  those used for filename and areas to save or restore  in
 P  or  G  class commands) are NOT saved by the journal.  They will be
 read by @ commands however and may be edited into a journal file with
 any  editor.   If  this  is desired inside a AnalytiCalc session, the
 Spawn command (below) is recommended after the +N command is used  to
 close  the  file.   The  VM  and RM commands are recommended inside @
 files (with R and V commands at the ends) to suspend display updating
 and  recalculation  until  all commands in the journal file are done.
 The Journal command is the way to get AnalytiCalc  to  remember  your
 keystrokes  when  making  up  any  command  so that you can tell what
 you're doing.  Later if you don't need to watch  the  screen  update,
 use  the  VM  command (View Manual) to turn display update off during
 the command files' operation, and the V (View)  command  to  turn  it
 back  on at the end.  The major uses of journaling are to save screen
 formats as they are set up and to allow capture of keystrokes for use
 in command macros.  

         Executing Other Programs or Commands from AnalytiCalc
        $ command-line     EXEC command line to the OS
                             (minus the $ sign). May
                             need extra CR to free
                             console.
        } command-line     EXEC command line (minus the })

AnalytiCalc Reference Manual                                   Page 50



                             and await a return on console
                             before return to sheet.

      The  $ command permits AnalytiCalc to spawn commands to the host
 OS.  The command is whatever follows the $ and results in  that  com-
 mand  being run as an AmigaDos RUN type command.  This permits use of
 other system utilities during a session with AnalytiCalc.  The  vari-
 ant  using the } character rather than the $ character will print the
 message ENTER RETURN TO REDRAW SPREADSHEET>  at  the  bottom  of  the
 screen  and  will  not  repaint  the  screen  until the return key is
 pressed.  This allows you to examine the screen as long as needed be-
 fore  erasing  and  redrawing the sheet.  NOTE that in a minimum 256K
 system you will NOT HAVE ENOUGH MEMORY  to  execute  other  commands.
 The size program you can run depends on the amount of memory you have
 left.  The commands are passed to COMMAND.COM and  executed  if  room
 enough exists to do so.  The graphics tasks are designed to be invok-
 able this way.  

                      Interactive Calculator Mode
 
      DROPPING INTO INTERACTIVE CALCULATOR
 
       K       Drop into interactive Calculator
 

      The  K command gets you into Calc, described below, and lets you
 do computations.  When you give the interactive Calc program  the  *E
 command  to  exit, you return to the spreadsheet.  This may be useful
 where you want to do auxiliary computations not in the  spread  sheet
 or  try  out formulas that you may want to debug interactively before
 entering them onto the sheet.  This calculator  knows  decimal,  hex,
 and  octal  radices  and  can be used to debug indirect command files
 written for use within spreadsheet cells;  the *V 3  command  can  be
 given  and  then  the  *@file  can be given in Calc mode, providing a
 trace playback of the actions of a command file to see what it is do-
 ing.  



AnalytiCalc Reference Manual                                   Page 51



                 Conditional Restart of Command Files
 
         LOOPING COMMAND FILES
 
      _<        Rewind the current AnalytiCalc input file
 

      This  command  will  allow a command file to restart itself from
 the beginning.  It does so only if the % variable is  positive  (per-
 mitting  some control over it).  A command file may use the TEst com-
 mand to set the % variable prior to this command.  

      An  <  found  in  a cell equation causes the cell equation to be
 re-evaluated from the start of the formula, PROVIDED that the "<"  is
 seen  at the start of one of the cell's equations, AND that the % ac-
 cumulator is greater than 0.0 at that time.  This is provided to  al-
 low   use  in  conjunction  with  *WF,  *P,  and  *U  XQTCM  so  that
 multi-equation formulas can loop, doing jobs like selecting rows from
 regions,  entering sequences of numbers, and the like.  This provides
 a compact and fast looping structure that does not depend on  rewind-
 ing files externally.  The *U XQTCM TE {V1 construct is not supported
 however.  The looping is limited to at most 100 passes to prevent in-
 finite loops.  


                           COMMENT commands
 
         COMMENTS
 
         * any text

      Any line beginning with * is treated by AnalytiCalc as a comment
 (except when in the *F mode when it is sought).  This allows  you  to
 comment your indirect AnalytiCalc command files.  



AnalytiCalc Reference Manual                                   Page 52



             Prompting for Data to be EDited into formulas
 
         READING ARGUMENTS OFF CONSOLE
 
         - Prompt

      The  "-"  command  will  print the prompt text on the screen and
 await entry of a line of text.  This text is stored as up to 4  argu-
 ments for possible later use in EDit commands.  Spaces separate input
 arguments, and no argument may be longer than  51  characters.   This
 facility  is  intended  for use with indirect command files (@ files)
 which may want to be able to prompt for parts of  formulas  and  then
 edit  them  into the command formulas for use, or to prompt for parts
 of later-used Calc commands.  Note that Calc never sees any  formulas
 that  are given the A format, so they can be prepared in this way, to
 be used when they are given a numeric format.  
      A suitable - command might be 

 -Enter net pay> 
      which would produce the printout (in row 23 of the screen) 
 Enter net pay> 
      and  to which one might reply with a number to be entered onto a
 "template" worksheet.  


                           Application Notes


      In  entering  numbers, use a decimal (.) to get them to go in as
 floating point.  If numbers are entered with no  decimals,  they  are
 considered  integers.  The system will convert the values to floating
 point for storage, but incorrect results have occurred where  formula
 ranges have been mixed since multi-argument functions assume the con-
 versions are all alike in their ranges, and  binary  formats  of  in-
 tegers and floating point numbers differ greatly.  

      Note that the default format for numeric output is F9.2 and that
 it may be changed if desired.  If you set up the format  of  a  cell,
 that  marks  the  cell  valid  and the format is not altered by input
 defaults, nor the numeric/text interpretation of the cell.  To put in
 a  lot  of  labels, then, set up format A using DF and then enter the
 labels.  

      If  the sheet's calculations contain forward references (down or
 right), you may need to give the R (Recalculate) command a few  times
 to  get  proper values.  If the values on the sheet do not stabilize,
 you probably have a circular reference in your  formulas  and  should
 examine  the cells that do not stabilize for the circularity.  Calcu-
 lation is done across first (along rows first).  This allows any file
 references to be as nearly sequential as possible.  

AnalytiCalc Reference Manual                                   Page 53



      If  you enter numbers with exponentials, use +/- in front of the
 E so that AnalytiCalc can tell that the "E4" type strings in  numbers
 like "1.3E4" are really exponents, not cell names.  That is, 
      Don't enter 
         1.35E4 
      Enter 
         1.35E+4 
 to  avoid  confusion  when  cells are relocated.  Filenames that look
 like cell names should be avoided too.  That is, a  sheet  that  con-
 tains a formula like 
 @D5.FRM 
 might, upon getting moved from D5 to F3, be changed to 
 @F3.FRM 
 and IF this is not what is desired, it could cause confusion.  

 Note  that column widths on the display are properties of the DISPLAY
 columns, not the PHYSICAL columns.  This  arises  because  a  display
 column  may  cover  potentially  20 different physical columns on the
 sheet due to mapping.  That is, column 3 may have cells from column C
 of the physical sheet, but can be set to have cells also from columns
 R, AZ, Q, and W (for example), with  different  display  formats  for
 each.   Rather  than  choosing  some width a function of the physical
 columns which could cause confusion, the width is  up  to  you.   The
 columns  are  labelled  with the physical cell column of the adjacent
 cell in the top row and also with the display column number  to  make
 it  easier  to enter DL commands, which use display coordinates (pure
 numeric, column:row) rather than physical coordinates  (alphanumeric,
 e.g.  AK15).  

                    Interactive Calculator Section
           THE CALC MODE OPTION (K) and Functions Available:

      This  describes the CALC option (K) of AnalytiCalc which is also
 the mathematical engine used for  expression  evaluation  except  for
 multi-argument functions and IF statements.  

      NOTE:  

      You will need to use the command 

      *V 3 

 to  get  any numbers displayed initially;  AnalytiCalc initially sets
 the display View flag to zero for speed reasons.  

                               OVERVIEW

      CALC  mode  is  a calculator designed to evaluate arithmetic ex-
 pressions.  In its basic form, expression evaluation  is  similar  to
 that  used  by  ANSI FORTRAN with calculations performed on INTEGER*4

AnalytiCalc Reference Manual                                   Page 54



 and REAL*8 constants.  Variables may also be invoked.   Standard  al-
 gebraic  operator  precedence is used, and accumulators (A through Z,
 %, and all spreadsheet cells) may be assigned values by  Calc  state-
 ments of the form:  

      Accumulator=expression 

      Additional  features  include  octal  and hexadecimal arithmetic
 capabilities.  Commonly used commands and expressions can  be  placed
 in a file and executed when convenient.  

                        How to Enter CALC mode

      To enter Calc, use the K command of AnalytiCalc.  Calc mode will
 prompt as follows:  

        CALC> 

 Before starting in this mode, type the command 

      *V 3 

      to get the interactive portion to display results.  Now try typ-
 ing 

        123+456 

 followed by a carriage return.  CALC will evaluate the expression and
 output the answer 
        579 

 It then prompts for further input.  Try other expressions such as 
     12.0 - 99.               (answer=-87.00000000000000)
     -(-32767+(6-2)**8-(512/(409-401)))   (answer=-32705)
     3*5/7                                     (answer=2)
     3*(5/7)                                   (answer=0)

      Mixed mode is legal, for example 

        1977/50.  is evaluated as 39.54000000000000 


 Reals may be expressed using D or E format.  For example 

        1.2E10*2.D0**3-1.D-8 is evaluated as 

        0.95999999999999992D+11 

                             Accumulators


AnalytiCalc Reference Manual                                   Page 55



      Variables  may  also  be  used  to  retain values for later use.
 Variables may be the letters A through Z, or any AnalytiCalc physical
 sheet cell name.  All accumulators default to REAL type.  To set I to
 a value use the usual FORTRAN syntax, for example:  

        I=2**10-1 

 Try  typing  the  single  character  'I'.  CALC will respond with its
 value.  We can now use I in various expressions such as 

        J=I-I/3*3 

      %  is  a special variable that retains the value of the last ex-
 pression evaluated.  For example, to successively add up the  numbers
 1, 2, 3, 4, 5, and 6 we could enter 
 
       1
       %+2
       %+3
       %+4
       %+5
       %+6

      Note  that  you can examine the value of the variables by typing
 the appropriate single character followed by a carriage return.  Such
 an examination does not change the value of %.  

                    Getting Back to the Spreadsheet

      To exit from CALC, type 

        *E (or *EXIT) 
     or *S (or *STOP) 

 This will return you to AnalytiCalc.  (To exit AnalytiCalc, use the X
 command.) 

            Mathematical Functions for Calc and AnalytiCalc
                          -SPECIAL FUNCTIONS-

      CALC recognizes a variety of special functions.  For example, to
 calculate the square root of 2, we can type 

        SQRT(2.) 

 CALC responds with the value 1.41421356237310 

      Each  function may have an expression for its argument.  For ex-
 ample, 


AnalytiCalc Reference Manual                                   Page 56



      A=2.0*SQRT(ALOG(9.)+3.) 

 sets A to 4.55948443459838 

      The following special functions are available:  

  FUNCT NAME   ARG TYPE    FUNCT VALUE   DESCRIPTION
  -------------------------------------------------------
  ABS          REAL        REAL         absolute value
  DABS         REAL        REAL         absolute value
  IABS         INTEGER     INTEGER      absolute value
  IFIX         REAL        INTEGER      REAL to INT conv.
  AINT         REAL        REAL         REAL truncation
  INT          REAL        INTEGER      REAL to INT conv.
  IDINT        REAL        INTEGER      REAL to INT conv.
  EXP          REAL        REAL         e**X
  DEXP         REAL        REAL         e**X
  ALOG         REAL        REAL         natural logarithm
  DLOG         REAL        REAL         natural logarithm
  ALOG10       REAL        REAL         logarithm base 10
  DLOG10       REAL        REAL         logarithm base 10
  SQRT         REAL        REAL         square root
  DSQRT        REAL        REAL         square root
  SIN          REAL        REAL         trigonometric sine
  DSIN         REAL        REAL         trigonometric sine
  COS          REAL        REAL         trig. cosine
  DCOS         REAL        REAL         trig. cosine
  TANH         REAL        REAL         hyperbolic tangent
  DTANH        REAL        REAL         hyperbolic tangent
  ATAN         REAL        REAL         arc tangent
  DATAN        REAL        REAL         arc tangent


      Note  that  the  multi  argument  functions  (e.g.   SUM[range],
 AVG[range], etc., are all also available in CALC mode with  the  same
 restrictions  mentioned above.  The IF [expression]yes-expr|else-expr
 command is however NOT available in CALC mode;  use the *J expression
 instead (see below).  

                  -WORKING IN OCTAL AND HEXADECIMAL-

      You  may  change the base used to specify constants by using the
 *B command.  Legal forms are 

      command              action
      -------              ------
        *B             displays current default base
        *B 8           changes default base to octal
        *B 10          changes default base to 10
        *B 16          changes default base to 16

AnalytiCalc Reference Manual                                   Page 57



      Suppose we have changed the default base to octal.  Then adding 

        7 + 1 

 we obtain the result 

        00000000010 (BASE 8) 

 If the default base is hexadecimal, we can enter 

        9 + 1 

 which is evaluated as 

        0000000A (BASE 16) 

 Suppose we have assigned 
        A=1 
 then 
        1+A 
 gives 
        2.000000000000000 

 even  when the default base is 16.  If we wish to add the hexadecimal
 digit 'A' to 1, enter 

        1+0A 

 We now obtain the desired 

        0000000B (BASE 16) 

      This  leading  0  is  only  necessary when the first hexadecimal
 digit is greater than 9.  

      If  constants are entered with digits that are not legal for the
 base being  used,  the  entire  number  is  converted  using  a  more
 appropriate  base.   For  example, if we have set the default base to
 octal and type 
        1+9 

      the  9 is not an octal number so it is converted to base 10.  If
 a base 16 number is involved, the result will be in base 16.  

      You  may  temporarily  change the base for a single integer con-
 stant by preceeding it with 

        ^8 for octal 
        ^10 for base 10 
        ^16 for base 16 

AnalytiCalc Reference Manual                                   Page 58




 For example, if the default base is 10, 
        100+^840 
 gives 
        132 

 a base 10 integer.  

        I=100+^1610 

 gives 
        116 

 also a base 10 integer.  

      Note  that  the '^' can only be used to specify the base of con-
 stants and that expressions such as ^16I are illegal.  

      To  declare  variables to be integers of a specific base, we can
 use the commands 
    *INTEGER        (base 10)
    *OCTAL          (base 8)
    *HEX            (base 16)
 for example, 
    *INTEGER A     declares variable A to be a
                   base 10 integer.
    *HEX B,Z,F     declares variables B, Z, and
                   F to be base 16 integers.
    *DECIMAL       lists all the variables that
                   have been declared to be
                   of type DECIMAL.


      To  summarize,  there  are  three  distinct  ways of making base
 declarations when using CALC.  The first is to use the *B command  to
 designate the base default value.  This is used to determine the base
 for constants when they occur in expressions.  It does not in any way
 influence the type of any variables found in an expression.  The only
 way to change the type of a variable is with a specific CALC  command
 such as 
        *INTEGER A,B 

      Note  that  the  *INTEGER  command  can be used to set types for
 AnalytiCalc cells.  However, exercise care in doing so that your dis-
 play formats match the new type.  
 Suppose for example that the default base is 10 and we enter 
        *OCTAL A 
        A=100 

 then CALC responds with 

AnalytiCalc Reference Manual                                   Page 59



        00000000144 (BASE 8) 

      Finally,  the  last  way to change a base is to use the explicit
 base specifiers for a constant, for example 

      ^10 123 
      ^8 777 
      ^16 AB 

                 Commands and Other Functions for Calc
                            and AnalytiCalc

      All  commands  to  CALC (as distinguished from expressions to be
 evaluated) begin with an asterisk.  To obtain a list of all  possible
 commands,  type  a question mark followed by a carriage return.  Most
 of the commands have already been described.  The  following  section
 gives  an  explanation of the remaining commands.  Many of these have
 the role of functions too, and may change the value of % or other ac-
 cumulators.  

     COMMAND            DESCRIPTION
     -------            -----------
  *@filename      Where  filename  is  the name of a file of CALC com-
               mands.  CALC reads the file and executes the  commands.
               Up  to 5 nested calls can be made.  Recursive calls are
               not allowed.  CALC prompts  with  CALC<n>  before  each
               command line is executed, where n is the calling level.
               You may optionally follow the file name  with  a  blank
               followed by a single variable name (a single alphabetic
               character or %).  CALC will then execute the file until
               the  value  of  that variable is zero or negative.  The
               test of this variable is made before the file  is  exe-
               cuted  and  not during execution of commands within the
               file.  If the variable's value is not positive when the
               command  is initially encountered, the file will not be
               opened for execution.   This  facility  allows  any  or
               every  cell  to  be  driven  by  command files while in
               spreadsheet mode.  
  *ASCII     Declares a list of variables to be of type ASCII.  Useful
               when decoding ASCII characters.  For example, if we set
               A  to be of type ASCII, then typing A=77 results in the
               character 'M' being output.  The inverse  operation  is
               the  single  quote.   It  allows us to specify a single
               ASCII constant.  For example, if we type 
               'M 
               then  the  character 'M' is echoed and indicates that %
               holds that character and has data type ASCII.   Suppose
               that the variable I has data type INTEGER.  Then we can
               output the base 10 code for the ASCII character 'M'  by
               entering 

AnalytiCalc Reference Manual                                   Page 60



               I='M 
               which  results in 77 being output.  Notice that you may
               not be able to enter certain  control  characters  that
               are  intercepted  by your operating system.  Characters
               whose value is less than 32.  are  output  by  printing
               the  character  '^'  followed  by  the equivalent ASCII
               character of that number plus 32.  For example, 
               A=10 
               results in 
               ^* 
               being  output  since  42  is  the  ASCII  code  for the
               character '*'.  See Appendix  A  for  a  table  of  the
               characters   output   by   CALC   to   represent   such
               non-printable characters.  
  *C      COMMENT  line.   The  characters  that follow are ignored by
               CALC.  This is useful when documenting files containing
               CALC commands.  
  *N      NOVIEW.   Prevents CALC from outputting the value of the ex-
               pressions evaluated.  This is  especially  useful  when
               executing  files containing CALC commands that initial-
               ize variables to special values.  Equivalent to *V 1 
  *V     VIEW.  Controls CALC's printing options:  

                 command    output class
                 --------   --------------
                  *V 0       error messages
               
                  *V 1       error messages
                             command lines read
                               from files
               
                  *V 2       error messages
                             value of expressions
                               evaluated
               
                  *V 3       error messages
                             command lines read
                               from a file
                             value of expressions
                               evaluated
                  *V         same as *V 3

               The  default  setting is *V 0.  Notice that other legal
               forms are *VIEW 1 and *V2.  You may want to  include  a
               command  *V  0 somewhere before using any command files
               to avoid diagnostic printouts if you use indirect  cell
               files much.  
  *R      READ.   Allows  a  single line to be read from the terminal.
               Useful in files of CALC commands  to  allow  additional
               commands to be entered (like *S to exit from that file)

AnalytiCalc Reference Manual                                   Page 61



               or simply as a way to halt terminal  output  until  the
               carriage return key is pressed.  
  *REAL     declares specified variables to be REAL*8.  When the value
               of such variables are output,  FORTRAN's  D  format  is
               used.  
  *DECIMAL      Declares  specified  variables to be REAL*8.  When the
               value of such variables are output, FORTRAN's F  format
               is  used.   Variables  A-H  and  O-Z  default  to  type
               DECIMAL.  
  *S     STOP.  Same as *E 
  *E      EXIT.   Terminates  CALC  session unless it is used within a
               file of CALC commands.  In this case, CALC  closes  the
               file and continues with the next command.  
  *Z      ZERO.   Zeroes  all  variables except %.  Data types are not
               changed.  
  *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 ad-
               dressed cell's value  is  retrieved  and  used  as  the
               resulting number.  This is used for lookup tables.  
  *W        Takes  the  value at the current cell and writes it out to
               the formula as a numeric (floating) value.  The current
               cell  may have been modified temporarily by the *P com-
               mand.  This will overwrite the formula  at  that  cell.
               The  *WF  command  will work the same as *W except that
               the format used for rewriting the number  will  be  the
               current  cell's  display  format instead of a pre-fixed
               D32.25 format.  Some extra  spaces  may  be  introduced
               which  may  be  removed by the command "ED / //".  This
               allows  freezing  values  to  whatever   precision   is
               desired.  
  *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 phy-
               sical 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  (not  the  Calc  @  command)  and seeks a line
               beginning with the characters *CLabel (where "label" is
               what  you  put after the *F command).  This allows Calc
               commands inside a cell to direct outside command entry. 
  *J         *J  Label  -  This  command behaves as the *F command but

AnalytiCalc Reference Manual                                   Page 62



               operates on the file used by the Calc @ command  rather
               than  the  AnalytiCalc  one.   Thus, conditions in Calc
               program files may be implemented.  

               Data File Access 

  *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?  <lm> 
        or *QW filename ?key1?  ?key2?  <lm> 
               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.  operation is that  the  file
               is  searched  from the beginning for records containing
               key1 (and key2 if specified) and then the part  of  the
               record  between  character l and character m (delimiter
               characters, which may be the same as for example 2 com-
               mas) is extracted.  That part of the record is then ei-
               ther Floated by converting to a floating  point  number
               using  a  wide Floating Point format specifier (in *QF)
               or read in and made the current cell's formula  between
               those delimiters (in the case of *QW).  Records may not
               be over 128 characters long.   This  command  would  be
               used to extract data from a database or word processing
               files.  

                    The  first key will begin at the start of the line
               for each file if it's first character is the `  (accent
               grave)  character.  Then the key searched for is sought
               always at the start of the line, minus the ` character. 

                    The delimiters may contain 3 characters to specify
               positional fields.  In this case, the  first  delimiter
               character  is  `  (again)  and the second 2 are encoded
               start location and length fields.  They  are  just  the
               binary  values  of these + 32 (starting from 1) to turn
               them to printable ASCII.  

                    Variant  forms are *QFK, *QWK (which keep the file
               open after opening it so that subsequent *QFN  or  *QWN
               or *QFC or *QWC commands can read sequentially down the
               file), or the mentioned *QFN and *QWN  commands,  which
               read the file from the Next record (leaving it open for
               more Next searches) and the *QFC or *QWC variants which
               perform  the  *QFN  type  action  but close the file on
               completion.  The file spec must  be  present  in  *QFN,

AnalytiCalc Reference Manual                                   Page 63



               *QWN,  *QFC,  and  *QWC commands, but is ignored there.
               If the search fails, the % accumulator is  returned  as
               -999999.   and on *QW type operations where there is no
               failure, the % accumulator returns a value  of  1.0  to
               indicate  success.   In the *QF commands, the value re-
               turned is in the file searched.   These  return  values
               occur  regardless  of  the variant.  Note that the same
               logical unit (4) is used for all *Q  class  operations,
               so  a subsequent *QF or *QW will close the unit after a
               string of *QN searches of indeterminate length.  A  re-
               quest  that searches the null device is a simple way to
               ensure the unit is closed.  It is possible to leave  it
               open  and  interfere with some other operations, so the
               user is cautioned to pay attention to  this  aspect  of
               program operation when designing a sheet that uses it. 
  *U  funct args      The *U command is a means to allow easy user ad-
               dition to  the  AnalytiCalc  function  repertoire.   It
               passes  the command line to the USRFCT subroutine which
               is set up to recognize up to  5-letter  function  names
               (edit it to add what you need) and to process the func-
               tions called.  The parsing is up to you.  Note that the
               VARSCN  routine may be called to convert variable names
               into coordinates in the XVBLS array.  

                    Functions supplied include:  
          DATE  functions  operating  on  dates:  IDATE, YRMOD, JDATE,
               JTOCH, and DATE which all  return  or  convert  between
               Julian   dates   (day   since   a   fixed   date)   and
               year/month/day binary, and ASCII dates.  
          MATRIX  functions  which  handle matrix math:  MTXEQ, MOVEV,
               MDET, MPROD, MADDV, MSUBV,  MMPYT,  and  MMPYC.   These
               handle all variants of normal matrix algebra.  MMPYT is
               particularly handy for producing the dot product  of  2
               rows  or columns (sum of products of corresponding ele-
               ments).  Note that matrix math works only in the  prime
               area  however.  That is, matrices must reside above and
               to the left of cell BI301 (so the legal range  for  ma-
               trices is A1 through BH300).  
          EQUATION  SOLUTION via the VARY function, which allows up to
               8 accumulators to vary to iteratively search for  solu-
               tions to equations anywhere on the sheet.  
          UTILITY  functions,  including STRVL, which converts formula
               text to numeric values, XQTCM which  executes  commands
               from  inside  formulas,  and HERE which returns current
               location and some extra sheet status information.  


               DETAILS:  


AnalytiCalc Reference Manual                                   Page 64



                    A version of USRFCT is supplied which can call the
               system to return the system month, day, and year in ac-
               cumulators  T,  U,  and  V respectively.  The % returns
               with a value of yymmdd to permit  easier  sorting  too.
               However, any functions desired may be added in this way
               and results extracted in whatever  way  is  convenient.
               The  yymmdd  value  returned  is a Julian date based on
               1/1/1980, in the % accumulator.  This  is  the  IDATE()
               function.  

                    There  are 4 other date functions supported in the
               most capable  AnalytiCalcs.   These  permit  conversion
               between  ASCII  dates  displayed as YY/MM/DD and Julian
               dates, or back.  

                    The call 

               *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.  

                    The call 

               *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.  

                    The call 

               *U JTOCH Jul,Var 

               assumes  that  variable Jul (any spreadsheet cell) con-
               tains a Julian date and changes it into an ASCII string
               in  the  cell  whose  name is in the Var position here.
               This wipes out  any  previous  formula  in  that  cell,
               though  it does not alter display format or type infor-
               mation.  The T, U, and V accumulators return  with  the
               month, day, and year on return.  

                    The call 

               *U DATE VY,VM,VD,Var 

               uses  VY,  VM,  and  VD  as  year,  month  and day, and

AnalytiCalc Reference Manual                                   Page 65



               computes a Julian date from them.  It then composes  an
               ASCII  string of form YY/MM/DD for that date and stores
               in the formula for Var.  

                    The  use  of Julian dates is made because the dif-
               ference of two Julian dates is precisely the number  of
               days  between  the  two  dates.   These  functions  are
               designed to make date labels easier to do.  

                    There  are  actually  4  supplied USRFCT routines.
               The larger of these are also able to solve matrix equa-
               tions  (this demonstrates how other programs may be in-
               tegrated with the package).  The  function  solves  the
               matrix  equation  AX=B where A is a square matrix and X
               and B are rectangular ones, A being n by n and X, B be-
               ing n by m.  

                    The call formats for IDATE and MTXEQU are 

               *U IDATE() 

               *U MTXEQ(AA:AA,XX:XX,BB:BB) 

               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.  This
               capability  is  used  to solve systems of linear simul-
               taneous equations and does so with extreme speed.  Note
               however  that  errors  can  occur  if  the  A matrix is
               singular.   The  cell  returns  0  if  the  matrix  was
               singular  and  does  not solve the equation then;  1 is
               returned if the equation was solved.  

                    Note  that  matrix A is modified by the call, so a
               reasonable precaution is to ensure that the  matrix  is
               reset  by  AnalytiCalc prior to each computation.  This
               may be done by:  
           1.  Placing the MTXEQ call in a cell left and down from the
               A matrix and 
           2.   Ensuring there are some alphas in each entry in matrix
               A.  This may be done by placing a  \*C FRC RECALC  into
               each  cell.   This is a comment and will not affect the
               number.    However   because   it   contains    alphas,
               AnalytiCalc  will  then re-compute each number whenever
               the sheet is computed.  

                    or 


AnalytiCalc Reference Manual                                   Page 66



                    Using the MOVEV function to copy the real A matrix
               onto the working one before the MTXEQU call every time.
               (This  is  the efficient way to do it, as recalculating
               the constants every time wastes resources.) 

                    To have the X matrix cells displayed without being
               modified, it is necessary to have the  cells'  formulas
               contain  a  self-reference.  The easiest way to achieve
               this is to place the "formula" P 0 0  into  each  cell.
               This  effectively will cause display of whatever number
               is there.  A similar technique may be used  to  set  up
               matrix A, where the real matrix is elsewhere and formu-
               las in A are just the P 0 0 type.  The real matrix  may
               contain  formulas  like  "34.65\D12=%"  to  set  up the
               desired contents here AND to reset  cell  D12  (in  the
               work  area)  to the entered value.  The B matrix is not
               modified by the MTXEQ routine.  A simpler way to handle
               the  problem  is  to  use the MOVEV function (below) to
               copy the desired cells  to  a  scratch  A  matrix  from
               wherever it was, so the scratch matrix may be destroyed
               without impact on display.  If this is done, the source
               of  the  A  matrix  need  not be specially bollixed up.
               Several additional functions exist in the  larger  ver-
               sions  of  USRFCT, the largest of which is designed for
               use with VAX due to space limitations on PDP11.  

               *U MOVEV mtxa,mtxb 

               where  mtxa  and mtxb are matrix specifiers.  This com-
               mand moves values from mtxa to mtxb  (useful  prior  to
               calling MTXEQ).  

               *U MDET mtx 

               This  function  computes and returns the determinant of
               matrix mtx (specified as v1:v2  where  v1  and  v2  are
               upper left and lower right corners of the matrix).  

               The  next  functions  are implemented in the largest of
               the USRFCT routines, and presently are limited  to  VAX
               implementations,  in  which they are present by default
               unless the build files are changed.  

               *U MPROD A,B,C 

               This function will multiply matrix A by matrix B giving
               matrix C, provided that their dimensions  are  compati-
               ble.   Note  this  and later functions may be available
               only on VAX versions of AnalytiCalc.  


AnalytiCalc Reference Manual                                   Page 67



               *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.
               It  can  be used for adding values in any pairs of rec-
               tangular regions much faster than a series of sum func-
               tions would permit.  

               *U MSUBV A,B,C 

               This  function subtracts matrix B from matrix A leaving
               the result in matrix C;  as  above,  matrix  dimensions
               must be the same.  It also is far faster in subtracting
               rectangular regions than  numerous  separate  equations
               would be.  

               *U MMPYT A,B,C 

               This function multiplies matrix A-transpose by matrix B
               and stores the result in matrix C;  dimensions must  be
               compatible.   Also,  as  in MPROD, matrix C must not be
               the same as either A or B.  In ordinary use,  this  can
               be  handy  for dot products.  That is, suppose you have
               two column parts, G10:G50 and R20:R60 and you  want  to
               form  the  sum  (G10*R20  +  G11*R21 + G12*R22 + ...  +
               G50*R60) for later use.  In many systems, you  need  to
               make another column of the G10*R20, etc.  terms and add
               it up.   Here,  you  can  use  the  MMPYT  function  as
               *U MMPYT G10:G50,R20:R60,G51:G51  to  form  the sum and
               store it in cell G51.  (It can be stored anywhere;  G51
               is chosen just for illustration.) If you have a row and
               a column to multiply, you use the  MPROD  function  in-
               stead  of  MMPYT  for  this.   Since this is a built in
               function, it can be orders of magnitude faster than the
               separate - column approach.  

               *U MMPYC A,B,K 

               This  function  multiplies every element of matrix A by
               constant K (a  cell  or  accumulator)  and  stores  the
               result  in  matrix B.  This function is FAR faster than
               separately multiplying many  cells.   If  you  want  to
               scale  a  rectangular  region of the sheet by some con-
               stant, this function can be used to quickly do so, mul-
               tiplying  each  cell  in  the region by the constant in
               cell or accumulator K (K can be ANY cell  or  accumula-
               tor).   Wherever  you need to adjust data by some frac-
               tion, this function should be used as the  fastest  way
               of doing it.  

AnalytiCalc Reference Manual                                   Page 68





               *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  dimen-
               sions.  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 frac-
               tion W about their initial values (later scaled down by
               the  gradient of the change in X) to attempt to get ac-
               cumulator or cell X to equal  accumulator  or  cell  A.
               This  is  done for I iterations, where I is another ac-
               cumulator.  Care should be taken that I is not initial-
               ized  in  every pass of the spreadsheet, but at most 20
               iterations will be done in any one pass as a  safeguard
               in  any  case.  The accumulators given must be indepen-
               dent variables;  set dependent  ones  or  normalization
               conditions elsewhere on the sheet for use with calcula-
               tions.  Any function or set of functions can be entered
               and  the  program will step the accumulators to attempt
               to find a (local) minimum of the value of (X-A) where X
               and  A  may be either accumulators or cells.  The other
               arguments must be accumulators (i.e., named  A  through
               Z,  though  prior automatic use of X, Y, and Z may con-
               flict if these are used).   This  function  will  allow
               iterative  solutions  to  be  found  for situations not
               soluble  directly,  with  stops  for  inspection  every
               several  iterations.   The  TE command may be used con-
               veniently to set the accumulator designated as  I  here
               without need to modify a cell to do so.  

                    The  VARY function is initialized by a negative or
               0 value in the I accumulator (the LOGICAL  one,  not  I
               itself).   The  equations controlling the variation may
               appear anywhere in the sheet, and variation  begins  at
               the initial values set into the varying ACs (P-W in the
               illustration).  Both the logical X and  A  accumulators
               may vary, as well.  

                    As an example, let us suppose we want to solve the
               equation A=SQRT(B) for B, given  A.   Humans  would  of
               course  just  square  both  sides,  but in an iterative
               solution, we would vary B until we found A.  The method
               used here performs the variations intelligently so that
               we actually approach the correct value  asymptotically;
               the  signal  we  have  a solution is that the variation
               stops.  To set this up, we might  enter  the  following

AnalytiCalc Reference Manual                                   Page 69



               equations  in  a  row  or column (or anywhere actually;
               order doesn't matter) in the sheet:  

               I=-1.\A=55.\P=12.\*C Set up to initialize 
                           with negative I, initial guess 
                           12., and desired value 55.  
               W=1.\*C Set "step scale" 
               P+0.\*C Display P accumulator on screen 
               B=SQRT(P)\*C Enter equation relating B, P 
               *U VARY B,A,W,I,P 

               Now we go back to the first equation, since the desired
               value in A (55.) has been set and the initial guess for
               SQRT(55.) has been entered (12.) and we may now set the
               number of iterations desired to drive the  calculations
               to solve the equation 
               B=A (which amounts to B=55.) 
               (which is what the VARY function does), by varying P to
               control B.  The idea here is that we can control P, but
               B  is  an  ARBITRARY  function of P (and possibly other
               AC's) and we will vary the independent AC's like  P  to
               find  what  THEY  need  to  be to arrive at the desired
               dependent "goal" values.  Here we are solving  B=A,  or
               B=55., or SQRT(P)=55.  and finding P in this way.  

                    In the first equation we now enter 

               I=10.\*C Enter some number of iterations 
                         to search for between displays.  

               and  for  every display, we will see how P varies since
               we are displaying P in one of the cells.  It will  con-
               verge on the square root of 55.  (which is 7.416) after
               some iterations.  We may just use the  TE  command  in-
               stead  to  set  the  I accumulator to avoid some of the
               complexity of messing with cells on the sheet.  We then
               use  the R (Recalculate) command after the TEst command
               to cause the solving to begin.  

                    Note that we could have more than just accumulator
               P varying and could have much more  complex  functions.
               Also,  both A and B could be functions of any or all of
               these accumulators.  Matrix computations may  be  used,
               or   any   other   functions   available   through  the
               spreadsheet, and the equations may be entered  anywhere
               on  the  sheet.  In this way, some quite powerful sorts
               of solutions to equations may be found.  The philosophy
               of  this  is  that if you know enough algebra to set up
               the equations for a problem (the hard  part),  you  can
               set  them up so the spreadsheet can solve them directly

AnalytiCalc Reference Manual                                   Page 70



               yourself, if there is a simple way to do so.  If  there
               isn't,  and if you can express the desired result as an
               equation, the  AnalytiCalc  program  can  do  iterative
               searching to try and solve the problem for you, varying
               up to 8 accumulators to do so.  If you really  want  to
               search for a situation in which several cells are close
               to several others, just make up an additional cell that
               is  the  "summed distance" between the desired targets.
               For example, if you want to arrive at a solution  where
               cell  B20 should approach B30, D25 should approach D35,
               and cell X15 should  approach  cell  AQ5,  make  2  new
               cells.   One  should be zero, and the other will have a
               formula that looks like 

               (B20-B30)**2+(D25-D35)**2+(X15-AQ5)**2 

               or  a  simple  variation, perhaps using multiplying in-
               stead of **2 as was done here.  This will  produce  the
               desired results, PROVIDED that the cells depend somehow
               on the accumulator values you are varying.  
           There are 2 more functions for the USRFCT.F40 sources which
               permit access to formulae and allow more flexible  com-
               mand procedures.  

                    The  function  *U XQTCM command  will  execute the
               command (terminated by the end-of-line), with any  com-
               mand except X or K permitted, from inside a cell.  This
               allows command files driven from cells to control  mov-
               ing  data,  etc.  It is suggested that cells containing
               these references in command files have the last command
               in the file set the cell format to [A] so that the com-
               mand execution will be once only, unless repeated  com-
               mands are desired.  

                    The function "*U STRVL V1,start;len" will return a
               value that is made from up to 8 characters in the  FOR-
               MULA  of  cell V1 (where V1 is any cell name), starting
               at character "start" and  for  "len"  characters.   The
               value  is  computed  such  that a numeric sort on these
               values is equivalent to an alpha sort on the  formulas;
               the  characters are multiplied from the left by 128 and
               the next ASCII value is added.  This  function  may  be
               combined  with the DS commands to sort on text, or with
               the XQTCM functionality to  drive  a  slower  but  more
               thorough sort on values.  

                    The function "*U HERE" will return the current lo-
               cation  on  the  matrix.   The  normal  result   is   a
               hash-coded  address of the physical cell pointed to, in
               the  %  accumulator,  and  the  column   and   row   in

AnalytiCalc Reference Manual                                   Page 71



               accumulators  T  and U respectively.  The row number is
               up by 1 (as the X,Y accumulators are at start  of  cell
               evaluation)  to account for accumulator storage.  Also,
               the flags for manual display update and manual recalcu-
               late  are  returned  in accumulator V.  The 4 bit being
               set means manual view is set on, and the  2  bit  means
               manual recalculate is on.  The W and Y accumulators re-
               turn the current maximum  column  and  row  used  also.
               These  are  designed to make it easy to use the IR com-
               mand (Inplace Relocate) to go over only cells in use.  

                    The  function  *U  FFTFW and the function *U FFTRV
               perform Fast Fourier  Transforms  in  the  forward  and
               reverse  (inverse)  directions  on  the  given range of
               data.  The largest power of 2 of data points less  than
               or   equal   to   the   given   range  is  used  and  a
               one-dimensional real FFT is performed.  This is  useful
               for digital filters and the like.  The input values are
               replaced by their FFT so it is best to work with values
               copied  from the real inputs (use the *U MOVEV function
               to move the values before use).  

                    The  function  *U  LINEF  Vy:Vy,Vx:Vx (with the Vx
               range optional) fits a line to  the  input  range.   It
               will  use  the Vx range as the X coordinate if supplied
               or will compute a range if none is supplied  using  the
               cell coordinates.  It computes the line equation Y=mX+B
               and returns the slope m in accumulator U and the inter-
               cept B in accumulator T.  The value returned in accumu-
               lator % from the function is the Y  fit  error  of  the
               line fit.  The W accumulator gets the correlation coef-
               ficient of X and Y.  
                    In the VAX/VMS and  Amiga versions of AnalytiCalc,
	       a call of form:  
  *U STxxxxxx range;range;...;range>outrange;outrange 
               so that the "xxxxxx" part is  the  function  name to be
	       called  will allow any function to be  called.    These
	       functions  must  be  linked  with AnalytiCalc, but they
	       need not be modified.  Input ranges of the  spreadsheet
	       are  copied  to  an internal scratch area and passed to
	       the function,  which  is called.  On return, the output
	       areas of the  spreadsheet  are  filled  in  with return
	       values in the scratch  area  which  were  passed to the
	       functions.  This facilitates adding  new  functions  to
	       AnalytiCalc,    since    pre-existing    code   can  be
	       incorporated  fairly painlessly via modification of one
	       "glue"  subroutine's  tables.   There is no requirement
	       for either  input  or output ranges, so constructs like
	       plotting packages and  the  like  could easily be added
	       via this mechanism.  

  *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 (normally  from  a  NUMERICALLY
               saved  sheet).   They  look  in  the given file for the
               named variable in the saved sheet and place the formula
               or  value in the current position of the current sheet.
               Note the *P commands may be used to reset the  position
               if  it  is desired not to overwrite the current formula
               in the case of the *XF command;  the  *XV  command  as-
               sumes the sheet was saved numerically and does not mod-
               ify the formula.  Note that each *X class command  gets
               1 number or formula.   This  command will NOT work with
               sheets saved with the PB commands.

AnalytiCalc Reference Manual                                   Page 72



                 AnalytiCalc File Interface Functions

      Command  level functions are given as FILcccccc where ccc is the
 actual command.  Equivalent functions are available from cells  using
 the  syntactic form *U DBcccccc arguments (where the "arguments" part
 is any arguments, generally some required.) 

      Some  extra  optional  VAX functions exist that allow regions of
 the sheet to come from or go to sequential or random files to or from
 some range of cells.  

      The  following  commands  exist  (the  "*U DB"  or  the "FIL" is
 omitted:) 



   OPINS range filename 
          Open  input  sequential  on filename for cells in range When
          the input file is open and any operation causes  a  read  of
          the  cell, the FORMULA will be taken from the file and used.
          If the file is opened with the OPINU  option  (for  Update),
          then  when  the FORMULA of the cell is written, it will also
          write to the file.  The OPINU option applies only to  random
          access  files.   Initially  both  input and output reads are
          disabled (ENAINP and ENAOUT enable them).  When a sequential
          file  (or  device such as a mailbox, pipe, or communications
          line) is used for input, it is  advantageous  to  read  data
          into a range once, then disable input/output again, to allow
          it to be handled between these  commands.   The  EDTINP  and
          FMTOUT commands are designed to do this to make it easier to
          use AnalytiCalc for a filter between sequential files.  
   OPINR range filename 
          Open input random on filename for cells in range 
   OPINU range filename 
          Open range for update on filename for read and write as ran-
          dom access.  
   CLSINP 
          Close input 
   CLSOUT 
          Close output 
   OPOUTS range filename 
          Open output sequential from range cells to filename 
   OPOUTR range filename 
          Open output random from range on filename 
   ENAINP 
          Enable input file readin (initially disabled) 
   ENAOUT 
          Enable output write (initially disabled) 
   DISINP 
          Disable input area readin 

AnalytiCalc Reference Manual                                   Page 73



   DISOUT 
          Disable output write 
   EDTINP 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.  
   FMTOUT range 
   VALOUT 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.  In the FMTOUT command the cell's  display  format  is
          used  for  the  conversion.   In  the VALOUT command a large
          builtin format is used to preserve all  significant  digits.
          Spaces  are  discarded prior to output.  Cells are left con-
          taining textual data corresponding to their numeric  values,
          stored in the formulae.  The DF command may be used to reset
          these cells to numeric types if desired.  Conversion  errors
          are ignored.  Input and output are disabled on completion of
          the command.  
   CMPFRM 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.  In that case the  value  of
          V3  will be used as the length of the formula for V1 and the
          value of V4 will be used as the length of cell V2.   If  ei-
          ther  value  in  V3 or V4 is outside the range 1 to 109 both
          values in V3 and V4 will be ignored.  Also on output  the  W
          accumulator  will  be set to -1.  if V1 is lexically earlier
          than V2, 0.  if they are lexically equal, and +1.  if V1  is
          lexically later than V2.  
   LENFRM V1:V2 
          returns  the  length of the formula for cell V1 in the % ac-
          cumulator 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.  
   TRMFRM 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.  The find  sub-
          string  function  CMPFRM can be used to find delimiter bytes
          if absolute columnar formatting is not desired.  




AnalytiCalc Reference Manual                                   Page 74



      Associated  DBxxxxxx  and FILxxxxxx commands both exist and have
 the same syntax.  

      These  commands  give  a means for having a spreadsheet template
 operate on files (treated as formula inputs or  outputs)  from  other
 independent  programs.   Random files have 128 byte record length and
 unique indices computed from the relative position in the range being
 used.   Sequential files are variable length but never have more than
 110 bytes (formula size) in them.  Interpretation of formulas  is  up
 to the spreadsheet.  

      On sequential reads, data is read until EOF and then the file is
 closed.  Input is treated as a "last step" before returning the  for-
 mula  to  the  main program and just overwrites any internally stored
 formula.  A dummy  edit  will  enter  the  file  data  into  internal
 storage.   On  output,  file  write  and internal storage both occur.
 Open failure just leaves the files closed.  

      "range"  means  v1:v2,  a  full  2 dimensional matrix range with
 upper left corner and lower right corner cells  specified.   Calcula-
 tion  order  is unaffected and generally is across fast, down slower,
 like a TV raster scan.  

      The  functions for CMPFRM and LENFRM are provided in addition to
 the other functions here to allow the spreadsheet to more easily  lo-
 cate  and  parse text in data coming from generic applications.  Note
 that the {cell constructs can be used (possibly with an  *U  XQTCM  E
 function)  to  move pieces of text around in conjunction with copies.
 The CMPFRM function can help find out if the reply from the  applica-
 tion is what is desired and already built-in conditional handling can
 be used for acting on this information.  

      As in all these functions, CMPFRM and LENFRM have the forms 
 FILCMPFRM and 
 FILLENFRM interactively, and 
 *U DBCMPFRM and 
 *U DBLENFRM in formulas (with the remaining arguments included.) 



      These   functions  are  meant  to  allow  some  "connection"  of
 AnalytiCalc with arbitrary other applications by batch files  or  EX-
 ECed  subprocesses,  where AnalytiCalc can produce inputs for another
 application's console input and accept another  program's  output  as
 its input in an intelligent and controllable way.  

      Also the string functions provided can be useful for certain ap-
 plications independent of file I/O.  



AnalytiCalc Reference Manual                                   Page 75



                         -ADDITIONAL FEATURES-

      CALC  is similar to FORTRAN with respect to operator precedence.
 Blanks may occur anywhere on a command  line  without  effect  except
 after  a  single  quote mark used to specify a single ASCII character
 constant.  CALC extends the  ANSI  FORTRAN  syntax  by  allowing  the
 following:  


       1.  multiple assignments on one line, for example 

          I=J=K=812 
       2.  Unary + and unary - are allowed, for example 
          2*-3 
          +2+-7 
          -2**4 
          are  all legal.  The last expression evaluates to 16 because
          the unary - has a higher precedence than exponentiation.  
       3.  exponentiation may be indicated by using !  as well as ** 

      If any of the declarations are entered (such as *INTEGER) and no
 argument to this command is given, then CALC will print out the vari-
 ables  that  have been assigned that data type.  Note that a variable
 can be assigned to different data types using such commands and still
 not  be assigned a value.  If you attempt to output the value of such
 a variable, an error message will result.  


                              USAGE NOTES
   1.  When you iterate on a file by a call such as 
            *@REPEAT X 
    then note that 
     A)  X  must have been set to a positive value when the command is
          executed or else the file will not be executed.  
     B) If the file of commands does not change the value of the vari-
          able X you will enter an infinite loop.  You can  explicitly
          set X to a non-positive value, use the *Z command to zero it
          (if it is not %), or include a 
          *R 
          command  to  give you a chance to reset the variable and get
          out of the loop.  
     C)  *E and *S will allow you to exit from the command file REPEAT
          but will not of themselves prevent repetitions.  
     D)  Entering  constants  echo  on  the  terminal  (assuming *V is
          properly set) and can change the value and type of the vari-
          able  %.  This is important to remember when using % to con-
          trol the iteration of a file.  
   2.  In FORTRAN, 
          -A**2 is the same as -(A**2) 
     with CALC, 

AnalytiCalc Reference Manual                                   Page 76



          -A**2 is the same as (-A)**2 (just like SNOBOL!) 
   3.  If R and A are positive reals and I is a positive integer, some
          compilers like RSX-11M's  F4P  won't  allow  (at  run  time)
          evaluation of 
          (-I)**R 
          (-A)**R 
   4.  Under RSX-11M F4P you will find 
          2**.5 to have value 1 
     while 
          2.**.5 has value 1.41421356237310 
   5.   10E10  is  a  hexadecimal constant (integer) while 10.E10 is a
          real.  

AnalytiCalc Reference Manual                                   Page 77



                              Appendix A

  ASCII  CALC   ASCII  CALC   ASCII  CALC   ASCII  CALC
  CODE   PRINTS CODES  PRINTS CODE   PRINTS CODE   PRINTS
  ----   ------ -----  ------ ----   ------ ----   ------
 
    0    ^      32            64     @      96     `
    1    ^!     33     !      65     A      97     a
    2    ^"     34     "      66     B      98     b
    3    ^#     35     #      67     C      99     c
    4    ^$     36     $      68     D      100    d
    5    ^%     37     %      69     E      101    e
    6    ^&     38     &      70     F      102    f
    7    ^'     39     '      71     G      103    g
    8    ^(     40     (      72     H      104    h
    9    ^)     41     )      73     I      105    i
   10    ^*     42     *      74     J      106    j
   11    ^+     43     +      75     K      107    k
   12    ^,     44     ,      76     L      108    l
   13    ^-     45     -      77     M      109    m
   14    ^.     46     .      78     N      110    n
   15    ^/     47     /      79     O      111    o
   16    ^0     48     0      80     P      112    p
   17    ^1     49     1      81     Q      113    q
   18    ^2     50     2      82     R      114    r
   19    ^3     51     3      83     S      115    s
   20    ^4     52     4      84     T      116    t
   21    ^5     53     5      85     U      117    u
   22    ^6     54     6      86     V      118    v
   23    ^7     55     7      87     W      119    w
   24    ^8     56     8      88     X      120    x
   25    ^9     57     9      89     Y      121    y
   26    ^:     58     :      90     Z      122    Z
   27    ^;     59     ;      91     [      123    {
   28    ^<     60     <      92     \      124    \
   29    ^=     61     =      93     ]      125    }
   30    ^>     62     >      94     ^      126    ^
   31    ^?     63     ?      95     _      127



            Interactive Calc in the AnalytiCalc environment

      Calc  runs as part of AnalytiCalc to do much of the math.  The K
 command drops into straight Calc and  it  works  as  described  here.
 There are a few additions however.  

      First,  Calc can access all the variables on the sheet (names a1
 and up), which may be up to 8 bytes  long.   However,  while  it  can
 examine or set any of these, the spreadsheet recomputes them from its

AnalytiCalc Reference Manual                                   Page 78



 disk based formula file when re-entered by the *E command.  To modify
 this  file,  the "current position" in the physical display sheet may
 be set by answering the prompts after giving the  *P  command.   Then
 the  current  display value (contents of the "%" variable) may be en-
 tered into the disk file by executing the *W command.  Numerous other
 manipulations are possible, and by setting the view level to 3 (*V 3)
 it is possible to debug a command file that drives a spreadsheet cell
 from  interactive mode (by tracing through its' operation to see what
 it is doing).  All interactive Calc commands work also from  indirect
 files.   The  physical location is clamped to legal values.  Note too
 that any unused cells of the sheet may be used as  scratch  accumula-
 tors.   However,  they may not assume any types of multiple precision
 numbers, as they are all 8 bytes long.  The internal expression stack
 is  40  tokens deep, so very complex expressions may have to be split
 into pieces to work.  Error messages will be shown if  this  happens;
 they are placed on the top line of the screen.  




                    The AnalytiCalc GRAPHICS System
 
                                ACGRAF

            GRAPHICS INTERFACE AND OUTPUT FROM ANALYTICALC



                             Introduction

      The  AnalytiCalc  system  uses a separate program to provide its
 graphics output, permitting  easy  tailoring  to  different  graphics
 devices.   The  routine supplied uses a character graphics subroutine
 (GHASP) to produce histograms and scatter  plots  from  any  rows  or
 columns  of a saved (numerically saved, that is) sheet which has been
 saved via the PPN or PDN commands.  The output is  printed  normally.
 However,  users  with other devices may easily modify this program to
 insert their own favorite graphics output device output into the pro-
 gram.  There are several options to govern plotting, and one plot per
 command is produced.  Once a saved sheet is generated, many plots can
 be made from it without reentering the sheet.  

      An advantage of this approach is that the address space consumed
 by the graphical routines is not taken from the spreadsheet.   Graph-
 ics  may  be  handled  with  a fair degree of transparency by command
 files, or even by spawned commands.  Another advantage is that  addi-
 tional  graphics  devices may be added easily without modification to
 the spreadsheet.  The current  version  uses  character  graphics  to
 permit  usable  displays  even on monochrome monitors.  (Note:  there
 are several additional graphics programs supplied which are given  in

AnalytiCalc Reference Manual                                   Page 79



 source   in   BASIC.   These  provide  additional  functionality  not
 described here but allow line  charts,  bar  charts,  piecharts,  and
 numerous other options.) 



      Getting Started:  

      Run  AnalytiCalc  (Type  ANALY)  and create your spread sheet to
 your liking.  When it is set, use the following commands:  

     L A1    go to cell A1 (top left of sheet
     PPN     Put out physical sheet numerically.
 
 When  AnalytiCalc  asks for a filename, give one which describes your
 file well (with a file  type)  followed  by  return.   Example:   My-
 file.num 

      When  AnalytiCalc asks you for maximum displacements, enter 0 in
 both cases (equivalent to telling it to save everything).  

      When done, you may use the X command to exit AnalytiCalc.  
 Now run ACGRAF by typing ACGRAF 
 When ACGRAF first starts, it asks for an output dataset.  This may be
 any file or device on the system.  If CON:  is used  as  output  (the
 terminal),  or  if  the filename chosen begins with the letters "TT",
 the graph will be scaled to fit on a terminal screen.   Otherwise  it
 will  be  sized to fit a sheet of (normally 132 column) printer paper
 and will have some extra  statistical  information  about  the  plot.
 When  ACGRAF runs, it will ask for a command line.  A typical command
 to give a scaled plot of column H from row 1 to row 30 would be 

 Enter plot command>NN myfile.num H1:H30 [S] 


      Note  that the rows and columns are referred to exactly s on the
 sheet itself.  The initial NN could be  LL  or  LN  or  PP  or  other
 letters,  but L in column 1 takes the logarithm of the numbers in the
 first (in the example the only) range of numbers selected, and  L  in
 column  2  takes  the log of the numbers in the second range.  A P is
 used instead of an N where the values displayed should start from  0.
 rather than from the lowest value in the region selected.  

      Should  the  range  to be plotted include only POSITIVE numbers,
 make the first 2 letters P's.  This will ensure the scale starts at 0
 rather than at the minimum positive value selected.  The command line
 would then look like:  

 Enter plot command>PP myfile.num H1:H30 [S] 


AnalytiCalc Reference Manual                                   Page 80



      Scatter  plots  plot  entries  in  the  first range against cor-
 responding entries in the second  range  selected.   One  dimensional
 plots  are up to 100 bins wide and scatter plots are up to 50 bins by
 50 bins.  Height of histograms is Scaled to fit a  page  if  the  [S]
 form is used and will Vary to whatever is needed if the [V] character
 is used.  Widths of plots are less than 100 (or 50) if the number  of
 entries plotted are less than those dimensions;  if the number of en-
 tries plotted is greater, it will be scaled to  the  50  or  100  bin
 maxima  (which  derive from paper size mainly).  If the option [H] is
 chosen, the plot will be Hacked off at one page, but scaled as if the
 [V] Vary option were specified.  


      SYNTAX AND USAGE:  

      This program is designed to allow an interactive user to enter a
 single command line to the program which  it  will  parse  and  allow
 graphic  output from AnalytiCalc saved spread sheets.  The assumption
 made is that the sheet has been saved with the PPN  or  PDN  command.
 The  filename  must  appear  in the command line and variables in the
 file (named AS THOUGH THE CURSOR HAD BEEN IN CELL A1 WHEN THE  PPN  /
 PDN  WAS  DONE)  may  be  histogrammed or scatterplotted against each
 other.  

 A  FORTRAN  plot  package for ordinary printers will be used for this
 version.  Other routines may be  readily  used  as  replacements  for
 specific  graphics  output  devices.   There  is  a document supplied
 PCSAVFMT.TXT which will give the format used to save AnalytiCalc/Por-
 taCalc  files to simplify reading them in.  The popular VisiCalc (tm)
 DIF format was NOT used in this program because it cannot encode  the
 variety of display formats available.  The format chosen was rather a
 straight ASCII format permitting almost  any  language  to  read  the
 saved  files with a minimum of grief, and which permits editing saved
 sheets with a  normal  text  editor.   (The  fields  are  even  comma
 separated to make reading in with BASIC easier.) 

 Input syntax:  
 PP or NN or LL filename.ext V1:V2 [c] V3:V4 +switches 
 where 

      an  L  in  columns  1 or 2 takes log of 1st or 2nd range numbers
 (base 10), a P indicates Positive numbers (so 0 is  included  in  the
 range  to  be plotted and the plot starts at 0.  and increases rather
 than starting at the minimum observed value for an  initialized  cell
 in  the saved sheet), and N means Normal, i.e., neither of the above;
 the minimum and maximum coordinates are taken as min and  max  values
 in the set of values to be plotted, 

      filename.ext  appears  at  the start of the command line after a
 space and with a space following it and is a valid RSX  or  VMS  file

AnalytiCalc Reference Manual                                   Page 81



 speciciation  (the  same  as was given to AnalytiCalc in the PP or PD
 command that saved the sheet normally).  

      V1:V2  and V3:V4 are ranges.  V3:V4 is optional and its presence
 implies a scatter plot.  These ranges must  be  either  a  row  or  a
 column  or part of them.  If only range V1:V2 is present, a histogram
 will be done using the Scale option of GHASP to fit the plot  onto  a
 page.   The plot will be set up for 100 bins horizontal, 50 vertical,
 or the number of entries to be plotted, whichever is less.  

      If  the  V3:V4 range exists, the character Q in the [c] position
 (the [] are required) will result in a "density" plot  in  which  the
 program  will  attempt to print darker in filled bins.  This is crude
 and the default is to use a 2 digit number.  Again, plot size will be
 scaled  to  50  by  50 bins.  For histograms, the character S implies
 Scale the plot to fit one sheet of paper,  the  character  H  implies
 Hack  the  plot  off  at  one sheet, and the character V implies Vary
 height, using as many sheets of paper as needed  to  plot  the  data.
 The  character  S should be used for "normal" scatter plots (in which
 number of entries in a scatter plot "bin" is represented as a  number
 or character).  

      To use ACGRAF from inside AnalytiCalc, use the $ command to pass
 the command line to the system;  this will allow graphics to be  done
 without  leaving  the AnalytiCalc environment.  This can be done from
 an indirect file driving AnalytiCalc also, without special  interven-
 tion, using normal DOS redirection commands.  

      Two  switches  are implemented.  +Hnnn sets Height of the result
 plot to nnn characters.  +Wnnn sets the Width of the result  plot  to
 nnn  characters.   Both  may  be specified for a plot;  they override
 default sizes.  They may be used to produce smaller graphs than usual
 for inclusion in documents or displays.  

AnalytiCalc Reference Manual                                   Page 82



                              Appendix B
                Discussion of Storage Allocation Issues


                     Storage Allocation Discussion

      If you use AnalytiCalc, the storage needed per cell in the work-
 file is 10 bytes per cell, and for formulas, 12 bytes of  formula  go
 into  every  16  bytes  of  workfile (the remainder is for accounting
 overhead).  Thus, for an 18,000 cell sheet, 180K bytes is the maximum
 useful  value  file  size, and 288K bytes would permit a 12 character
 formula for each cell, while 2592K bytes would give  every  cell  108
 characters  and  is  the maximum useful size.  (You can allocate more
 memory to allow 109 characters per cell, but  this  usually  will  be
 mostly  wasted.) Since a symbol table algorithm is used, sizes may be
 as small as desired.  If the size chosen is less than the memory  al-
 location  built  in (1K is guaranteed to be), no files will be opened
 and cells will be stored in memory only.  Note that if value and for-
 mula file sizes are given negative, a slower but sometimes more effi-
 cient packing will be done of the file.  The workfiles are opened  in
 one's  default device at the time of running the program.  The "slow"
 algorithm picks a diskfile page to use by taking the cell number mod-
 ulo the number of pages in the file.  The "fast" one picks a diskfile
 page to use by taking the position in the total  sheet  (columns  in-
 creasing  fastest)  and making the number of cells in a diskfile page
 vary as number in the sheet divided by  the  size  of  the  diskfile.
 Thus,  cells  close to one another on the sheet are kept close on the
 disk file.  This can overflow a disk page if too  many  cells  for  a
 page  are  used close to each other.  Therefore, the program will ask
 you how many rows and columns you propose to use for purposes of disk
 clustering.   If  the "fast" algorithm is used, the disk page will be
 chosen as (cell address)*(number of disk pages  total)/(size  of  the
 total  sheet  you  said you'd use, clamped to the max physical size).
 If you say you'll use a small area, cells will be  scattered  better.
 If you use beyond the area you said, disk pages are chosen in modular
 fashion.  Therefore, if you run out of room in  a  file,  try  either
 varying  the  size  for allocation, or adding space to the files.  If
 you give the exact size you're really  using,  the  "fast"  algorithm
 will equally divide disk pages among cells on the screen you're using
 for rectangular use.  The size question is ignored if the "slow"  al-
 gorithm  is used, since that algorithm equipartitions without needing
 to know the size used.  Typical values to use for the number of  rows
 and  columns  you intend to use for small problems might be 16 by 16.
 The program asks how big to make the disk  based  files  next,  given
 that it now knows how to allocate cells to the files.  

      There  are  two effects of importance here.  First, if you don't
 allocate enough space, scratch files may overflow and you'll have  to
 save  the  sheet and rerun with bigger files.  Second, if the scratch
 files are TOO big, the program will waste  time  switching  pages  in

AnalytiCalc Reference Manual                                   Page 83



 memory  unnecessarily.  Therefore, when you tell AnalytiCalc how much
 space you intend to use, it prints out the sizes of files needed  AS-
 SUMING  that  you will fill in EVERY cell in the range indicated, and
 that formulas are 12 or less characters long.  If you use less cells,
 both  files may be shorter.  If formulas are longer, the formula file
 needs to be made bigger.  The program won't actually go out  to  disk
 unless  the  files  are  bigger  than its in memory buffers, so don't
 worry about that condition.  The suggested sizes are usually  a  good
 guess.   (These  are printed on the screen after you tell it how many
 rows and columns you intend to use.) 

AnalytiCalc Reference Manual                                   Page 84



                              Appendix C
                       AnalytiCalc Logical Names


      AnalytiCalc/Amiga  has  a  symbol table and allows you to define
 symbolic names of up to 16 characters length, containing  letters  or
 numbers, and use them inside equations.  

      To define a symbolic name, use the command 

 TE {SYMBOLICNAME=Vn 

 where Vn is a cell name (like A5, R17, AB122, or the like), and "SYM-
 BOLICNAME" is the name you wish to define.  The  name  is  now  asso-
 ciated with the CONTENTS OF the cell named (as Vn).  When you use the
 construct {SYMBOLICNAME in an equation, the contents of the cell  as-
 sociated  with  that  name replace the name prior to evaluation.  Any
 contents may be used, though the total resulting string must not grow
 to  over  109 characters.  Recursive substitutions are permitted to a
 depth of 20, so name definitions may use other name definitions.  

      To remove a name definition, use the command 

 TE {SYMBOLICNAME=0 

 You  should  remove definitions explicitly since they are not automa-
 tically removed by adding new definitions.  

      Up  to 301 names may be defined in the sheet.  Note that scratch
 cells A0 through approximately BK0 may be used to hold definitions if
 desired.  

      To  store  cell  definitions  for later use, the special command
 must be used as follows to save them:  

 TE {*= 

 This  will  cause  AnalytiCalc  to ask for an Output file.  You reply
 with a filename to store (or show) the definitions.  The program will
 then  dump  all known symbol definitions in the same format needed to
 do the definitions of the names.  If a disk file is specified, it can
 be read in via the @file command so the symbols may be redefined to a
 later AnalytiCalc run.  

      Storing  definitions  on a CON:  window can give a quick look at
 them interactively, but usually it is better to print the definitions
 (which  can  be  done by giving PRT:  (or your printer's real name if
 that's not it) as the output file name.  


AnalytiCalc Reference Manual                                   Page 85



      This  facility can save considerable formula typing time.  Where
 you have a very large formula to be duplicated many times, if it  can
 be  specified  relocatably,  a  reference to a short name (or a cell,
 since {name and {cell function the same) can save storage  and  allow
 you to get by with smaller disk work files.  
 EXAMPLE RUN:
 
 L D0                    ;  go to phantom cell D0
 ET SUM[A1:A4]           ;  fill in a macro definition as text
 TE {SALES=D0            ;  define "sales" as this sum
 M2                      ;  set automatic motion down
 L A1                    ;  go to A1 
 E 2.3                   ;  enter some junk data just to show this
 E 4.86
 E 1.2647
 E 8.3454
 EV {SALES               ;  Enter sales value as a numeric.
         ;  the cell will display the sum of A1 thru A4.

 An example position independent formula might be:  

 SUM[ P#0#-5:P#0#-1] 

 which  means  the  sum of the cells from 5 above the current physical
 cell to 1 above the physical cell.  This form if used in a name  will
 work wherever it is used, regardless of location.  

AnalytiCalc Reference Manual                                   Page 86



                              Appendix D
                     AnalytiCalc Function Summary


      The available multiple argument functions are:  
   SUM[variables]     Sum of all arguments
   MAX[variables]     Max of arguments
   MIN[variables]     Min of arguments
   AVG[variables]     Average of arguments
   AVE[variables]     Average of arguments excluding zero args
   STD[variables]     Standard deviation squared
   AND[variables]     Boolean AND of all variables in list
   IOR[variables]     Boolean inclusive OR of variables
   NOT[variable]      Boolean complement of variable
   XOR[v1,v2]         Boolean exclusive OR of v1,v2
   EQV[V1,V2]         Boolean "equivalence" of V1,V2
                      (complement of exclusive OR, true if
                      bits have the SAME value)
   CNT[variables]     Number of nonzero variables in list
   MOD[V1,V2]         Returns V1 modulo V2 (i.e., remainder
                      of V1/V2 division.)
   SGN[v1]            Returns 1.0 times sign of V1
   LKP[var,variables] Lookup variable in "variables" range
                      greater or equal to var, return its
                      index (starting with 0) into variables
                      range.
   LKN[var,variables] Lookup variable in "variables" range
                      less than or equal to var, return its
                      index (starting with 0) into variables
                      range.
   LKE[var,variables] Lookup variable in "variables" range
                      strictly equal to var, return its index
                      (starting with 0) into range. Note all
                      LKP, LKN, LKE return the last variable
                      index if no satisfactory value found.
   NPV[disc,vars]     Net Present Value of vars (equal time
                      interval numbers), at discount rate
                      disc where disc is a fraction
                      (e.g., .12 for 12%)
   IRR[PV,FV,returns] Internal Rate of Return. Will compute
                      internal rate of return on up to 20
                      periods, returning rate per period.
                      The returns are expected to be at
                      equal time intervals. PV and FV are
                      initial and final values of investment
                      and the result is computed via Newton
                      approximation.
    PMT[princ,inter,nper] Payment (mortgage payment per period)
                      function. Will compute payment per period
                      for principal amount "princ" with interest

AnalytiCalc Reference Manual                                   Page 87



                      per period as "inter" and number of periods
                      as "nper". All arguments must be cells.
                      The formula is the standard ordinary annuity
                      formula. Interest rate must be a fraction so
                      that 14% would be 0.14, for example.
    PVL[payment,inter,nper] Present Value formula. Computes present
                      value of an annuity given "payment", the payment
                      per period, interest rate per period (as a
                      fraction, so 12% is 0.12) in "inter", and
                      number of periods as "nper". All arguments
                      must be in cells.
    RND[DUM]          Generates a random number between 0. and
                      1.0. An argument is needed but it is
                      NOT touched by this function.
 .INDEX Random numbers
 .Index RND function
 
    IF [V1.rel.V2] statement | else-statement
     Compares two variables and executes either "statement" (if the
      relation is true) or "else-statement" (if the relation is
      false).
     Valid relations (in the place of the .rel. above) are:
       .EQ.    Equal
       .NE.    Not Equal
       .GT.    Greater than (V1 greater than V2)
       .LT.    Less than (V1 less than V2)
       .GE.    Greater than or Equal to (V1 >= V2)
       .LE.    Less than or Equal to (V1 =< V2)


      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 single argument functions are available:  

  FUNCT NAME   ARG TYPE    FUNCT VALUE   DESCRIPTION
  -------------------------------------------------------
  ABS          REAL        REAL         absolute value
  DABS         REAL        REAL         absolute value

AnalytiCalc Reference Manual                                   Page 88



  IABS         INTEGER     INTEGER      absolute value
  IFIX         REAL        INTEGER      REAL to INT conv.
  AINT         REAL        REAL         REAL truncation
  INT          REAL        INTEGER      REAL to INT conv.
  IDINT        REAL        INTEGER      REAL to INT conv.
  EXP          REAL        REAL         e**X
  DEXP         REAL        REAL         e**X
  ALOG         REAL        REAL         natural logarithm
  DLOG         REAL        REAL         natural logarithm
  ALOG10       REAL        REAL         logarithm base 10
  DLOG10       REAL        REAL         logarithm base 10
  SQRT         REAL        REAL         square root
  DSQRT        REAL        REAL         square root
  SIN          REAL        REAL         trigonometric sine
  DSIN         REAL        REAL         trigonometric sine
  COS          REAL        REAL         trig. cosine
  DCOS         REAL        REAL         trig. cosine
  TANH         REAL        REAL         hyperbolic tangent
  DTANH        REAL        REAL         hyperbolic tangent
  ATAN         REAL        REAL         arc tangent
  DATAN        REAL        REAL         arc tangent
  ASIN         REAL        REAL         arc sine
  DASIN        REAL        REAL         arc sine
  ACOS         REAL        REAL         arc cosine
  DACOS        REAL        REAL         arc cosine
  TAN          REAL        REAL         Tangent
  DTAN         REAL        REAL         Tangent


      The following "equation commands" also act as functions with the
 effects described:  
  *@filename      Where  filename  is  the name of a file of CALC com-
               mands.  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 ad-
               dressed 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  (floating)  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:  

AnalytiCalc Reference Manual                                   Page 89



             *P - By itself, *P causes Calc to prompt for the new phy-
               sical 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?  <lm> 
        or *QW filename ?key1?  ?key2?  <lm> 
               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  <lm>  part  of  the  command   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.  


AnalytiCalc Reference Manual                                   Page 90



  *U JTOCH Jul,Var 

               assumes  that  variable Jul (any spreadsheet cell) con-
               tains 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 com-
               putes a Julian date from them.   It  then  composes  an
               ASCII  string of form YY/MM/DD for that date and stores
               in the formula 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 ma-
               trices.  

  *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

AnalytiCalc Reference Manual                                   Page 91



               matrix C, provided that their dimensions  are  compati-
               ble.  

  *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 matrix 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  dimen-
               sions.  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 frac-
               tion W about their initial values (later scaled down by
               the  gradient of the change in X) to attempt to get ac-
               cumulator or cell X to equal  accumulator  or  cell  A.
               This  is  done for I iterations, where I is another ac-
               cumulator.  

  *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"

AnalytiCalc Reference Manual                                   Page 92



               characters.  

  *U HERE 

               will  return the current location on the matrix and the
               current maximum row and column used.  T,U get col, row.
               W,Y get max col, row used.  

  *U FFTFW and *U FFTRV perform Fast Fourier Transforms in the forward
               and reverse (inverse) directions on the given range  of
               data.  

  *U LINEF Vy:Vy,Vx:Vx (with the Vx range optional) fits a line to the
               input range.  Eqn:  y=Ux+T.  % gets err,  W  gets  cor.
               coef.  
  *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 When the input  file  is  open  and  any
               operation  causes  a read of the cell, the FORMULA will
               be taken from the file and used.  If the file is opened
               with  the OPINU option (for Update), then when the FOR-
               MULA of the cell is written, it will also write to  the
               file.   The  OPINU option applies only to random access
               files.  Initially both input and output reads are  dis-
               abled  (ENAINP and ENAOUT enable them).  When a sequen-
               tial file (or  device  such  as  a  mailbox,  pipe,  or
               communications  line) is used for input, it is advanta-
               geous to read data into  a  range  once,  then  disable
               input/output  again,  to allow it to be handled between
               these commands.  The EDTINP  and  FMTOUT  commands  are
               designed   to   do  this  to  make  it  easier  to  use
               AnalytiCalc for a filter between sequential files.  

  *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.  skip 1 
  *U DBCLSINP Close input 

AnalytiCalc Reference Manual                                   Page 93




  *U DBCLSOUT Close output 

  *U  DBOPOUTS  range filename Open output sequential from range cells
               to filename 

  *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 com-
               mand.  

  *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.  In the FMTOUT  command  the  cell's
               display  format  is  used  for  the conversion.  In the
               VALOUT command a large builtin format is used  to  pre-
               serve  all  significant  digits.   Spaces are discarded
               prior to output.  Cells  are  left  containing  textual
               data  corresponding  to their numeric values, stored in
               the formulae.  The DF command  may  be  used  to  reset
               these  cells  to  numeric types if desired.  Conversion
               errors are ignored.  Input and output are  disabled  on
               completion of the command.  

  *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.
               In that case the value of V3 will be used as the length
               of the formula for V1 and the value of V4 will be  used
               as  the length of cell V2.  If either value in V3 or V4
               is outside the range 1 to 109 both values in V3 and  V4
               will be ignored.  Also on output the W accumulator will
               be set to -1.  if V1 is lexically earlier than  V2,  0.
               if  they  are  lexically  equal,  and  +1.   if  V1  is

AnalytiCalc Reference Manual                                   Page 94



               lexically later than V2.  

  *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 un-
               desired  parts.  The find substring function CMPFRM can
               be used to find delimiter bytes  if  absolute  columnar
               formatting  is not desired.  As in all these functions,
               CMPFRM and LENFRM have the forms 

AnalytiCalc Reference Manual                                   Page 95



                              Appendix E
                             NEW FEATURES

      The  following features were added to AnalytiCalc after the last
 edit to the manual:  

      1.  Extended cell addressing.  

      This  feature  allows  you to treat the spreadsheet as though it
 contained 18000 rows and 18000 columns.  You can use any  storage  in
 any  part of this range.  Thus, columns from A through ZPH are legal,
 and rows from 1 to 18000 are legal.  

      The actual storage in virtual memory is still treated as a prime
 area of 60 by 300 cells, but extended areas move down  the  sheet  as
 you go further to the right of the 60 columns, and right on the sheet
 as you go further down.  The increments on overflow start at 50  rows
 and  10  columns, but can be reset by questions in the "modify widths
 and mapping" section of the S (setup) command.  The  mappings  chosen
 are saved and restored in PP and GP commands.  

      This  allows  you  to use the storage as a giant area, though it
 can run out.  (No possible one-CPU machine could really compute a 325
 million cell sheet, if all cells were full, quickly enough to be use-
 ful.) 

      Because  it can be confusing to figure out what is going on, the
 Add (AR and AA) commands that insert or delete whole rows or  columns
 do  not  work  in extended addresses (i.e., beyond 60 columns and 300
 rows).  When using extended addressing, and after you have cells  set
 up  in the extended area, you should NOT alter the mappings via the S
 command, nor should you use the AA or AR commands.   All  other  com-
 mands work normally.  

      3.  The sheet save and restore now saves values in a PPX command
 as well as formulas.  It also saves column widths and the  number  of
 rows  and  columns being displayed.  If you specify a 4th character M
 in the command (e.g., PPXM instead of  just  PPX),  AnalytiCalc  will
 save  the  display-to-physical  mapping in its saved sheet as well as
 the other sheet information.  This  considerably  extends  the  saved
 size, so it is optional.  Setting up your mapping while journaling is
 turned on, and then playing back a journal file, will still use  sub-
 stantially  less  disk  space, though having all the information in a
 saved sheet makes reload simpler.  
          The PP commands have now the following effects:  
          PPN  Save  numerical values (and labels) only.  Formulas are
               NOT stored;  only numeric values are.  
          PPX Save both numeric values and formulas.  The output files
               contain two records per cell used, one  containing  the
               value and the other containing the formula.  On reload,

AnalytiCalc Reference Manual                                   Page 96



               the value record sets the cell value, and  the  formula
               record  sets  the formula (which may cause the value to
               change once a recalculation is done).  The value record
               is  first  and it's first character is "p" (lower case)
               while the  formula  record's  first  character  is  "P"
               (upper  case).  See the BASIC graphics programs for how
               to read the format, or type a saved sheet  out  to  see
               how it looks.  Use this form of save for most purposes. 
          PPF  Saves formulas only, not values (though a single recal-
               culation generally produces values).  Use this for tem-
               plates  where  the data values are not meaningful or to
               save room.  This sort of save cannot  however  be  used
               for  graphics, and the *XV command will not find useful
               values everywhere in such a saved sheet.  
          PDN  Saves  Display sheet numerically only.  Like PPN except
               that the offsets used are in Display  coordinates,  not
               relative to the physical sheet.  
          PDF  Saves  Display  sheet, Formulas only.  No display sheet
               save of "both"  numbers  and  formulas  is  implemented
               since  the  display  sheet is smaller than the physical
               one and two saves can be  easily  done  when  both  are
               needed.  
          PxxM Where "xx" can be PN, PF, DN, DF, or PX - Saves Mapping
               as well as the sheet.  This saves extra  records  (with
               row  and  column  numbers  offset by 64000 to keep them
               from confusing graphics programs) that allow Get (GP or
               GD  or  GPR) commands to set up the display to physical
               sheet mappings automatically.  Thus, you can  save  all
               your  windows  and  have  them  back  automatically  on
               reload.  The mapping is saved from the  current  cursor
               location down and right only.  
          The  G  (Get)  class commands are unchanged except that they
               now reset all the new saved quantities  when  they  are
               seen.   Old saved sheets receive default values for the
               column widths, numbers of rows/columns,  mapping,  etc.
               so their behavior is not altered.  

      V18-04 has the following new features:  

      1.   If  you have an ACINIT.PRM file, it will be kept open as an
 initializer file until EOF and may contain any AnalytiCalc  commands.
 HOWEVER, if you use the file, it MUST contain at least the replies to
 all questions until you  arrive  at  the  spreadsheet's  "calculation
 screen".   It  can  be  used to preset cell contents or perform other
 setups.  Note that the ZA command allows you to reset storage parame-
 ters  and  the  like, so having them preset by a startup file in this
 way does not reduce the generality of the program.   It  is  often  a
 good  policy to do this to get the program started, as the setup com-
 mand can contain typed strings to initialize ANSI.SYS or  to  set  up
 internal  function key meanings without having to rely on an operator

AnalytiCalc Reference Manual                                   Page 97



 or   an   external   batch   file   to   do    so.     The    command
 %escape sequence to type%*%*% will just type the escape sequence;  it
 may be used in ACINIT.PRM (after the part that answers initial  ques-
 tions) to type any desired escape sequences for setting up the screen
 or whatever if that screen control method is chosen.  


      L AO0
 ET 1
 L AW0
 ET 2
 L AR0
 ET 3
 L AT0
 ET 4
 L A1

 Note  that AB0 corresponds to code 59, and so on.  AO0 corresponds to
 72, AW0 to 80, AR0 to 75, and AT0 to 77 here.  The  1,2,3,or  4  that
 are  entered are the cursor move commands in command mode, entered as
 text so they cause no calculation overhead.  Note that IF YOU HAVE AN
 ACINIT.PRM, IT will be read, NOT your console, for initial questions.
 (You can get the initial queries back with the ZA command however.) 



                        New Features of V18-07B

      AnalytiCalc  V18-07B  supports  use  for project management.  To
 make this run efficiently, the selection functions were  modified  to
 record  which  cell  was selected.  Thus, the MAX, MIN, LKP, LKN, and
 LKE functions now return the column and  row  (respectively)  of  the
 cell  they  find  in accumulators P and Q respectively.  The function
 "*P@ P0,Q0" may be used to directly access this  cell  in  subsequent
 calculations,  or the P and Q accumulators can be used in other forms
 of addressing to access the selected cells.  The functions  otherwise
 behave as they did in earlier releases.  

      The   project   management  software  (AnalytiProject)  will  be
 distributed only to registered (i.e., paying) users of AnalytiCalc.  
                        New Features - V18-07C

      AnalytiCalc  V18-07C  adds two functions to support computations
 in "workdays".  

         *U WKDYS V1,V2 

 takes  Julian dates in variables V1 and V2 and computes the number of
 workdays between the two, not counting the initial date if  it  is  a
 workday (to be similar to differences between Julian dates).  

AnalytiCalc Reference Manual                                   Page 98




         *U WKDIN V1,V2 

 takes  a Julian date in V1 and a number of days in V2 and returns the
 Julian date that is V2 workdays after the date in V1.  It is  thus  a
 sort  of  inverse  for  the *U WKDYS function.  The resulting date is
 guaranteed to be in the Monday to Friday range.  A workday is  Monday
 to Friday.  The functions know nothing of holidays.  
                        New Features - V18-08A

      In  V18-08A,  AnalytiCalc can compute line fits and Fast Fourier
 transforms on data.  

         *U LINEF Y1:Y2,X1:X2 

 computes  a line whose equation is Y=mX+B, where m is returned in the
 U accumulator and B is returned in the T accumulator.  The %  accumu-
 lator returns the fitting error in Y.  The line is fit over the range
 Y1:Y2 in Y, with the X coordinates optional and if they are  present,
 they  must  be in the cells in the X1:X2 range given.  If the X range
 is omitted, 1.  to the max.  number of points will be used.  

         *U FFTFW V1:V2 

 computes the forward (t to freq) Fourier transform of the range and 

         *U FFTRV V1:V2 

 computes the reverse (freq.  to t) transform.  The range  must  be  a
 power  of two long (if less, the largest power of 2 available is used
 and extra points are ignored).  Data is assumed to be the real  coef-
 ficients in the first half and the imaginary ones in the second half.
 FFT data is returned in this layout also.  Thus, the real data (which
 is  frequently  the part of interest) is returned first.  The reverse
 FFT of the forward FFT returns the original data.  The FFT is of  in-
 terest for finding the frequency distribution of partially sinusoidal
 distributions.  

                        New Features - V19.01A

      A  modified command structure is supported now.  If you type the
 command /;  then the commands to AnalytiCalc are modified as follows: 


      1.  Any  command  beginning  with  a digit (except single digits
          standing alone) is treated as an EV followed by the text.  

      2.  Any  command beginning with / has the / stripped off and the
          rest is treated as a command.  


AnalytiCalc Reference Manual                                   Page 99



      3.  Any  command  beginning  with  " is treated as an E" command
          (enter text) with the " stripped out.  

      4.  Anything not starting with a digit, a " character, or a / is
          treated as an Enter command and is prefixed with "EN  "  and
          used.  


      The old (default) command mode is restored with the command "//"
 so that /;  and // switch between the two.   These  commands  may  be
 given  in ACINIT.PRM, other command files, or from the console.  They
 introduce incompatibilities in that in the new version commands  like
 "DF  range [format]" must be entered as "/DF range [format]" (for ex-
 ample) to work.  

      To  facilitate writing command files that work in both modes the
 command / switches  the  mode  with  a  save  cell.   A  sequence  of
 commands:  

  /#             (save current command mode in save cell)
  //             (enter old command mode)
 ...
  (do all of command file)
 /#              (restore saved user command mode)

 will  allow  a command file to operate and be written to run predict-
 ably in either user environment choice.  

      Please  NOTE  that special characters in the first character are
 interpreted as commands in /;  mode.  The * character is handled as a
 comment.   To  enter formulas with functions starting with *, use the
 COMMAND form, e.g.  /EV *U IDATE.  This always works  and  disambigu-
 ates syntax.  

      When the system is in /;  mode, the cell prompt at the 23rd line
 of the screen ends with :  so that it appears like 

 AB 21:  

      When  the system is in // mode (initial default) the prompt ends
 with the > character so it appears like 

 AB 21> 

 This should aid in distinguishing modes during use.  
                         New Features of V19.2

      In  V19.2, AnalytiCalc adds the OAD and ORD commands.  These are
 like the OA and OR commands except they leave the  relative  mappings
 of  the  screen alone.  Thus, if you already split your screen into 3

AnalytiCalc Reference Manual                                  Page 100



 parts and use the command "OAD cell" to reset the mapping, the resul-
 tant screen still has 3 regions at the same relative positions as be-
 fore.  If you use the ORD command, then only the part of  the  screen
 right and down from the cursor is affected, but any screen partition-
 ing is maintained.  If these commands leave some  areas  pointing  to
 nonexistent  areas, use a command OR or OA to reset the areas desired
 to something real again.  V19.2 added the change from > to :  at  the
 end of the prompt depending on // or /;  modes also.  

      New Features - V19-03A 

      The  recalculation  has added 2 new modes in V19-03, Recalculate
 Incremental (the initial default), and Recalculate Entry.  

      The R command re-establishes the old default mode which recalcu-
 lates ALL formulas  on  the  whole  sheet  for  every  entry  of  new
 material.  

      The RI command sets Recalc Incremental mode which recomputes all
 cells on the display screen, but skips non-displayed cells.  

      The  RE command sets Recalc Entry mode which ONLY recomputes the
 newly entered formula, leaving the rest alone.  (It  is  reliable  in
 the  "prime"  region  of  the  sheet but may fail in extended address
 areas.) 

      The  RR command is equivalent to RF (Recalculate, FORCE recompu-
 tation of constants), EXCEPT that it leaves  the  mode  alone  so  if
 AnalytiCalc is in RI or RE mode, it stays that way.  

      Note  a  full  recalculation is done after Get commands (loading
 saved sheets) regardless of mode.  

      The  command  ..  (two periods at the start of a line) in a com-
 mand file closes the command file and returns to the  console.   This
 has  not  previously  been  documented  though  the function has been
 present for some time.  

      It  is recommended that RE or RI mode be used instead of RM mode
 (which completely disables recalculation) during data entry if  other
 modes are too slow.  AnalytiCalc may be obtained from Glenn Everhart,
 25 Sleigh Ride Rd., Glen Mills, PA 19342, for $25.00 (I'll supply the
 disk for that;  I ask only $10.  to register it however.) 

AnalytiCalc Reference Manual                                  Page 101



                                 INDEX


 *XV Function 

 AA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   95
 AA Command . . . . . . . . . . . . . . . . . . . . . . . . . . .   11
 Access to Saved Sheets . . . . . . . . . . . . . . . . . . . . .   71
 Accumulators . . . . . . . . . . . . . . . . . . . . . . . . . .   29
 ACINIT.PRM . . . . . . . . . . . . . . . . . . . . . . . . .   96, 97
 AR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   95
 AR Command . . . . . . . . . . . . . . . . . . . . . . . . . . .   11
 Arguments  . . . . . . . . . . . . . . . . . . . . . . . . . . .   29
 Auto Motion 
 Availability . . . . . . . . . . . . . . . . . . . . . . . . .    100
 AVE Function . . . . . . . . . . . . . . . . . . . . . . . .   24, 86
 AVG function . . . . . . . . . . . . . . . . . . . . . .   24, 25, 86

 Boolean Functions  . . . . . . . . . . . . . . . . . . .   24, 25, 86

 C Command 
 Calculation Order  . . . . . . . . . . . . . . . . . . . . . . .   52
 Case Conversion  . . . . . . . . . . . . . . . . . . . . . . . .   22
 Cell Addressing  . . . . . . . . . . . . . . . . . . . . . . . .   95
 Cell Commands  . . . . . . . . . . . . . . . . . . . . . . . . .   31
 Cell Names . . . . . . . . . . . . . . . . . . . . . . . . .   32, 87
 Cell Precision . . . . . . . . . . . . . . . . . . . . . . . . .   77
 Column Width Set . . . . . . . . . . . . . . . . . . . . . . . .   19
 Command Arguments  . . . . . . . . . . . . . . . . . . . . . . .   20
 Command File Limitations . . . . . . . . . . . . . . . . . . . .   33
 Command Files  . . . . . . . . . . .   31, 32, 33, 49, 52, 61, 87, 89
 COMMAND MACROS 
 COMMANDS . . . . . . . . . . . . . . . . . . . . . . . . . . . .    7
 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . .   51
 Conditional Loops 
 Conditional Motion . . . . . . . . . . . . . . . . . . . . .   61, 89
 Console Arguments  . . . . . . . . . . . . . . . . . . . . . . .   52
 Copy 
 Current Position . . . . . . . . . . . . . . . . . . . . . . . .    7
 Cursor Motion 

 Data Base Access . . . . . . . . . . . . . . . . . . . . . . . .   32
 DB Command . . . . . . . . . . . . . . . . . . . . . . . . . . .   13
 DF Command . . . . . . . . . . . . . . . . . . . . . . . . . . .   14
 Display  . . . . . . . . . . . . . . . . . . . . . . . . . . . .    7
 Display Format . . . . . . . . . . . . . . . . . . . . . . . . .   14
 Display Type . . . . . . . . . . . . . . . . . . . . . . . . . .   19
 Displayed Entity . . . . . . . . . . . . . . . . . . . . . . . .   15
 DL Command 
 DS Command . . . . . . . . . . . . . . . . . . . . . . . . . . .   18

AnalytiCalc Reference Manual                                  Page 102



 DT Command . . . . . . . . . . . . . . . . . . . . . . . . . . .   19
 DW Command . . . . . . . . . . . . . . . . . . . . . . . . . . .   19

 E Command  . . . . . . . . . . . . . . . . . . . . . . . . . . .   21
 EDIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   20
 EDIT, Special Constructs . . . . . . . . . . . . . . . . . . . .   20
 EMPTY CELLS 
 ENTER Command  . . . . . . . . . . . . . . . . . . . . . . . . .   21
 Equation Solving . . . . . . . . . . . . . . . . . . . . . .   68, 91
 Exit 
 Extended Area  . . . . . . . . . . . . . . . . . . . . . . . . .   95
 Extract Saved Value 

 F Command 
 FFT 
 FFTFW function . . . . . . . . . . . . . . . . . . . . . . . . .   98
 FFTRV Function . . . . . . . . . . . . . . . . . . . . . . . . .   98
 File Loading 
 File Merging 
 FORMAT . . . . . . . . . . . . . . . . . . . . . . . . . . .    5, 14
 FORMAT Microtutorial . . . . . . . . . . . . . . . . . . . . . .   16
 Formula Indirection  . . . . . . . . . . . . . . . . . . . . . .   27
 Formula Length . . . . . . . . . . . . . . . . . . . . . . . . .   33
 FORMULA SEARCH . . . . . . . . . . . . . . . . . . . . . . . . .   48
 Formula to Text  . . . . . . . . . . . . . . . . . . . . . .   14, 22
 Formula Value Access . . . . . . . . . . . . . . . . . . . .   70, 91
 Formulas . . . . . . . . . . . . . . . . . . . . . .   22, 32, 33, 87
 Fourier Transforms 
 Frame Editing 
 Freeze . . . . . . . . . . . . . . . . . . . . . . . . . . .   61, 88
 Function Arguments 
 Function Summary . . . . . . . . . . . . . . . . . . . . . . . .   86
 Functions  . . . . . . . . . . . . . . . . . . .   24, 29, 56, 60, 87
 FVL (Future Value) function  . . . . . . . . . . . . . . . . . .   86
 FVL Function . . . . . . . . . . . . . . . . . . . . . . . . . .   24

 G Command  . . . . . . . . . . . . . . . . . . . . . . . . . . .   36
 Goal Seeking . . . . . . . . . . . . . . . . . . . . . . . .   68, 91
 GOTO (Locate) Command  . . . . . . . . . . . . . . . . . . . . .   38
 Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . .   43

 Help . . . . . . . . . . . . . . . . . . . . . . . . . . . .   22, 37
 Hexadecimal  . . . . . . . . . . . . . . . . . . . . . . . . . .   58
 Histograms 

 IF conditional . . . . . . . . . . . . . . . . . . . . .   24, 25, 86
 IF statement . . . . . . . . . . . . . . . . . . . . . . . . . .   29
 Indirect Addressing 
 Indirect Cell References . . . . . . . . . . . . . . . . . . . .   30
 Indirect Command Execution . . . . . . . . . . . . . . . . . . .   70

AnalytiCalc Reference Manual                                  Page 103



 Initialization . . . . . . . . . . . . . . . . . . . . . . . . .   96
 Input Region . . . . . . . . . . . . . . . . . . . . . . . .   72, 73
 Insert or Delete Rows or Columns . . . . . . . . . . . . . . . .   11
 Integers . . . . . . . . . . . . . . . . . . . . . . . . . . . .   19
 Interactive Calculator . . . . . . . . . . . . . . . . . . . . .   50
 Internal Loops . . . . . . . . . . . . . . . . . . . . . . . . .   51
 IRR function (Internal Rate of Return) . . . . . . . . .   24, 25, 86

 Journaling . . . . . . . . . . . . . . . . . . . . . . . . . . .   49

 Keypad Command Files . . . . . . . . . . . . . . . . . . . . . .   22
 Keypad Commands  . . . . . . . . . . . . . . . . . . . . . . . .   22
 Keystroke Capture  . . . . . . . . . . . . . . . . . . . . . . .   49

 L Command  . . . . . . . . . . . . . . . . . . . . . . . . . . .   38
 Line Fits  . . . . . . . . . . . . . . . . . . . . . . . . . . .   98
 LINEF function . . . . . . . . . . . . . . . . . . . . . . . . .   98
 Linking Sheets . . . . . . . . . . . . . . . . . . . . . . . . .   34
 LKP, LKN, LKE Lookup Functions . . . . . . . . . . . . .   24, 25, 86
 Loading Saved Sheet  . . . . . . . . . . . . . . . . . . . . . .   36
 Locate current . . . . . . . . . . . . . . . . . . . . . . . . .   38
 Lookups 
 Looping  . . . . . . . . . . . . . . . . . . . . . . . .   51, 61, 89

 M Command 
 Matrix Algebra . . . . . . . . . . . . . . . . . . . . . . . . .   66
 Matrix restrictions  . . . . . . . . . . . . . . . . . . . . . .   63
 MAX function . . . . . . . . . . . . . . . . . . . . . .   24, 25, 86
 MEMORY USE . . . . . . . . . . . . . . . . . . . . . . . . . . .    6
 MH Command . . . . . . . . . . . . . . . . . . . . . . . . . . .   39
 MIN function . . . . . . . . . . . . . . . . . . . . . .   24, 25, 86
 Mixed Relocatable Names 
 Mixed Relocation Override  . . . . . . . . . . . . . . . . . . .   28
 MOD Modulo function  . . . . . . . . . . . . . . . . . .   24, 25, 86
 Moving . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   38
 MS command . . . . . . . . . . . . . . . . . . . . . . . . . . .   39
 Multiple Equations . . . . . . . . . . . . . . . . . . . . .   23, 30

 New Features . . . . . . . . . . . . . . . . . . . . . . . . . .   95
 Notes  . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   52
 NPV (Net Present Value) Function . . . . . . . . . . . .   24, 25, 86
 NS No Scroll (Scroll Disable)  . . . . . . . . . . . . . . . . .   10
 Number Format  . . . . . . . . . . . . . . . . . . . . . . .   52, 53

 OA command . . . . . . . . . . . . . . . . . . . . . . . . . . .   40
 OAD command  . . . . . . . . . . . . . . . . . . . . . . . . . .   40
 Octal  . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   58
 OR command . . . . . . . . . . . . . . . . . . . . . . . . . . .   40
 ORD command  . . . . . . . . . . . . . . . . . . . . . . . . . .   40
 Origin Control Commands  . . . . . . . . . . . . . . . . . . . .   40

AnalytiCalc Reference Manual                                  Page 104



 Other Features . . . . . . . . . . . . . . . . . . . . . . . . .   75
 Other Functions  . . . . . . . . . . . . . . . . . . . .   30, 59, 60
 Output Region  . . . . . . . . . . . . . . . . . . . . . . .   72, 73

 P Command  . . . . . . . . . . . . . . . . . . . . . . . . . . .   43
 PARAMETER SUBSTITUTION 
 PMT Function . . . . . . . . . . . . . . . . . . . . . . . .   24, 86
 Position Independent Cell Names  . . . . . . . . . . . . . . . .   33
 Position Independent Names . . . . . . . . . . . . . . . . . . .   27
 PPF command 
 PPX Command  . . . . . . . . . . . . . . . . . . . . . . . . . .   95
 Prime Area . . . . . . . . . . . . . . . . . . . . . . . . . . .   95
 Printing Large Reports . . . . . . . . . . . . . . . . . . . . .   18
 Project Management 

 Random Numbers 
 Ranges . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   28
 RB COMMAND . . . . . . . . . . . . . . . . . . . . . . . . . . .   45
 RECALCULATE  . . . . . . . . . . . . . . . . . . . . . . . . . .    4
 Recalculation  . . . . . . . . . . . . . . . . . . . . . . . . .   52
 Redraw Command . . . . . . . . . . . . . . . . . . . . . . . . .   46
 Relations  . . . . . . . . . . . . . . . . . . . . . . . . . . .   29
 RELOCATE BOUNDARY  . . . . . . . . . . . . . . . . . . . . . . .   45
 Relocation . . . . . . . . . . . . . . . . . . . . . . . . .   11, 33
 Replicating 
 RND Function 

 S Command  . . . . . . . . . . . . . . . . . . . . . . .    6, 43, 95
 SAVE . . . . . . . . . . . . . . . . . . . . . . . . . . . .    6, 43
 SC Scroll enable . . . . . . . . . . . . . . . . . . . . . . . .   10
 Scatter Plots 
 SCRATCH FILES  . . . . . . . . . . . . . . . . . . . . . . . . .    6
 Scrolling control  . . . . . . . . . . . . . . . . . . . . . . .   10
 Self Location  . . . . . . . . . . . . . . . . . . . . . . . . .   71
 Set Title  . . . . . . . . . . . . . . . . . . . . . . . . . . .    6
 Setting Number of Cols . . . . . . . . . . . . . . . . . . . . .   13
 Setting Number of Rows . . . . . . . . . . . . . . . . . . . . .   13
 Solving For Variables  . . . . . . . . . . . . . . . . . . .   68, 91
 Sorting  . . . . . . . . . . . . . . . . . . . . . . . .   18, 70, 91
 Sorting, by ASCII  . . . . . . . . . . . . . . . . . . . . .   70, 91
 Special Accumulators . . . . . . . . . . . . . . . . . . . . . .   55
 Special Cell Addressing  . . . . . . . . . . . . . . . . . . . .   27
 Startup control  . . . . . . . . . . . . . . . . . . . . . . . .   97
 STD (Std Deviation) function . . . . . . . . . . . . . .   24, 25, 86
 Storage Allocation . . . . . . . . . . . . . . . . . . . . . . .   82
 String Functions . . . . . . . . . . . . . . . . . . . . . .   72, 73
 Subprocess Execution . . . . . . . . . . . . . . . . . . . . . .   50
 SUM function . . . . . . . . . . . . . . . . . . . . . .   24, 25, 86
 Symbolic Names . . . . . . . . . . . . . . . . . . . . . . . . .   84


AnalytiCalc Reference Manual                                  Page 105



 TE Command 
 Temp.  Escape to Monitor . . . . . . . . . . . . . . . . . . . .   50
 Temporary Motion 
 Temporary Move . . . . . . . . . . . . . . . . . . . . . . .   61, 88
 TEst Compute 
 Text Entry . . . . . . . . . . . . . . . . . . . . . . . . . . .   22
 Text to Formula  . . . . . . . . . . . . . . . . . . . . . .   14, 22
 TITLE  . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    6

 Value Freeze 
 Variable Names . . . . . . . . . . . . . . . . . . . . . . . . .   27
 VARY . . . . . . . . . . . . . . . . . . . . . . . . . . . .   68, 91
 VIEW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    4
 View Command . . . . . . . . . . . . . . . . . . . . . . . . . .   46
 View Control . . . . . . . . . . . . . . . . . . . . . . . . . .   60

 W Command  . . . . . . . . . . . . . . . . . . . . . . . . . . .   47
 Weekdays Functions . . . . . . . . . . . . . . . . . . . . . . .   98
 Where Matrices Can Be  . . . . . . . . . . . . . . . . . . . . .   63
 Windows  . . . . . . . . . . . . . . . . . . . . . . . . . . . .   40
 Word Processing  . . . . . . . . . . . . . . . . . . . . . . . .   35
 Workfiles  . . . . . . . . . . . . . . . . . . . . . . . . . . .   82
 Writing Screen to File or Print  . . . . . . . . . . . . . . . .   47

 X Command 

 ZAP Sheet Command  . . . . . . . . . . . . . . . . . . . . . . .   48
 ZEro Command . . . . . . . . . . . . . . . . . . . . . . . . . .   48


