AnalyRim was first designed to run on a pdp-11 (16 bit mini) where address space was
limited to 28k words. While that system had an excellent overlay system and link
editor, large memory was not there. Therefore access to spreadsheet cells was
done with some routines that could read and write cell information, and cell
information was possible using direct access files. These made it possible to
have routines that would read cell (row, col) and write it, and just access the
values using read or write of disk records. 
To store the formulae a separate file was devised, which held the cell formula
and the display format used (as in a Fortran FORMAT statement) for that cell. A
cell could be either floating point or integer in this way. 
The formula file had 110 bytes for the formula and 10 bytes for the format and
a few flags to indicate things like whether any value existed and whether any
references to other cells were there (so calculation need not recompute a cell
by default.
The original record was 128 bytes long, allowing for fairly efficient disk
retrieval. 

This has been kept in place a long time, just using memory arrays in larger
address space systems.
However, to allow cells to have formulae that run longer than 110 characters
the program has been given PARAMETER statements (in the aparms.inc file) to allow
larger formula arrays. The JFrmlen, Jfrmdir anbd JFrmasz parameters can be defined
larger and the program compiled for larger values here. This will give a larger
array in memory but can handle more material.

The older version is kept around; there were lots of places the size of this record
were used and it is possible some dependences on size were mis-recognized. By using
jfrmlen=109, jfrmdir=110 and jfrmasz=128 the original sizes are used. Making them
larger (e.g. jfrmlen=199,jfrmdir=200 and jfrmasz=218) would in principle allow
longer formulae (in the example above, 199 characters), and note the formulae
in Analyrim may have multiple substatements so this can give considerable support
for complexity.

AnalyRim really needs to have RIM ripped out and replaced by a better DBMS since
RIM is pretty lame. However probably not much if anything uses the *U DBxxxx 
formula commands so this may not matter much. 

Also the program uses ANSI terminal escape sequences to draw its screen, which
works ok but is less fancy than newer programs of this sort. Back in 1982 when
this was designed first, the fancy screen stuff did not exist.
There is a routine UVT100 that is called from all over to put material on
screen, mostly from the DSPSHT routine, which also can route output to files
or a printer instead of screen. UVT100 can move to a location and can write
content. Some bits of the code can note where it is writing and emit color
controls, and it also sends sequences to set normal or reverse video in
appropriate places. It does NOT have anything current to draw lines around
the cells it is drawing, which would be nice to add. When writing to screen
it just handles one cell at a time (except label rows) so while you can get
UVT100 to know to draw a cell in, say, red (does this sometimes for negative
values in VC mode) you need to be sure anything like dotted lines under each cell
are there with every cell. Also it is positioning everything based on 
terminal row and column number, has no real idea of pixels on a larger screen. A
better display would probably want to put dotted lines under each cell row and
use a slightly smaller font so the dotted lines did not get overwritten all
the time. Since the terminal characters are fixed size, figuring where they
are might be simple but you have to keep this in mind. The input is read in
raw mode, and escape sequences get transformed to commands @DK:somecommand.cmd
to run a command file for each function. This defers a lot to the command files
(I supply a number of these) so much can be done but if you want some fancy
command, you need to write the files. They are NOT limited to 110 characters
but can be whatever size you like. Note that the "move area to area" functions
are done by command files using the looping built into individual formulae, so
they run decently fast. In Linux you will find Analyrim is a decentlyt fast
program, but pretty well unique and its command structure looks like nothing
else. 
Note that the basic system has a "physical sheet" spreadsheet that looks like
other spreadsheets, cell names A1, A2,,,B1,B2...C1,C2,C3... and so on. There
are LOTS of address modes for cells though that allow multidimensions and
many indirections. The name P#row#col means the physical cell that is "row" down
and "col" right of the current cell.
There is also something called a "display sheet" in which each cell in the
display is a separate mapping to a cell in the physical sheet. This can be
as complex as you like. The two start out mapped the same. The cell named
D#row#col however means the cell "row" down and "col" right in the display
sheet, wherever that is mapped. 
In addition to the spreadsheet cells note there are accumulators named A to Z
which are used some places to hold information or to return it. For example
when you use the MAX[cell,cell,cell... or cell range] function, in addition to
the function returning the desired MAX function, a couple accumulators will 
return the location of the cell that held it in a form you can address with
one of the cell address modes. Thus you don't need separate functions to get
this information. (It was handy when writing a GANTT chart program to have this.)

