Changes to build

3/14/2025: Added pseudo function PLT[...] to make a file in /tmp/acvs.tmp
that has values it is passed. This is for plot programs to use (e.g. gnuplot)
and is terminated by a cell holding over a billion. Example use:
L D3     move to D3 to store terminator value
E 1000000000.  store a billion in it
TE PLT[C2:C55,D3]

Result is values in C2:c55 are in the file /tmp/acvs.tmp and can be used. Be
sure to clean this out or it gets appended to.
Use the TE (test) command like this to run the PLT[] function since it will
nastily slow the spreadsheet if inserted in the sheet itself. Recall you
can still use command PPN to store values of the whole sheet, but together
with other formatting information that you probably won't want to plot.

3/11/2025: Looked over mouse code. It was flaky in that it seemed to fail
but this was due to being too picky with mouse buttons. Changed so when
mouse codes are handled it won't care what button is there. Now in that
mode it will go to cell clicked on by mouse. This mode is turned on by
commands like VBM or VCM and turned off by VBN or VCN. Defaults to no mouse
recognition.  Mouse recognition on xterm is a little weird. Changed verion to
V40B.
3/4/2025: Found what was wrong with making the formula array size parametrized
and fixed it. Analyrim has a variety of novel functions but if it should be
desired to allow longer formulae on individual cells this should allow it.
Note that cell formulae may contain multiple statements each, and cells can
run scripts individually off disk, so the size limit is normally not too
constraining.
I will note that the selection of command files from keys depebds on the exact
escape sequences a computer and terminal program generates for each special
function key. The default set of these was devised for VT220 terminals and the
like and laptops tend not to keep that mapping the same. :
3/2/2025: The effort to make formula variable did not work well. Reverting but
leaving the "analypivot-vary109.for" code around for possible future
reference. Use Makefile as a guide to building, or use makanaly-bld.shl as a
shell script to compile. Assumes you copy the binaries and "analyticalc"
script from here into a binary location, for the moment /usr/local/bin.
2/28/2025: Realized that the original (1982) design fit into a 16 bit mini by
putting much onto direct access disk files. The cell formula contents were
kept in 128 byte records where the first 110 bytes were the formula, then some
flags, and the last 8 bytes were display format. (The original system used
disk files for values too.) I have edited the source by adding some parameters
to aparms.inc (which holds all parameters) and the source files so the
dependence on the 128 byte size is removed and parameters can be set to allow
longer formulae. (Values in aparms.inc currently leave the actual values the
same.) No functional changes were done in this.
1/31/2019: Worked on ttyin() routine and xqtcmd parsing of escape sequences. Still
needs work to get command files called right but expanded the number of command
files in /DK/ that can be called.
	Moved a bunch of older material into subdirectories so main directory of
analylinux.zip or analyrimlinux.zip (same, copies of each other) has only the
current version. Copied analy (executable) into "bin" directory.
	Ensured readme.1st file tells correctly how to build and install. Might
not need build, as I found how to link Fortran library statically into the image.
	Added xtset.sh script as a way to record settings for xterm. I have resisted
temptation to set window dimensions by program for now. 
	Dyked out (old slang: cut out with wire cutters) symbol compress/decompress
routines. With larger cell ranges, the compressed codes might collide with some 
function names and not that much space is saved anyway.
2/1/2019: Found some more parsing errors in escape sequences from xterm,
fixed. This happens in cmdmun routine. Built debug version that traces
commands as read (left it in a subdirectory) so I can see what command files
are called. Some sequences use lowercase 3rd char in name so they don't
exhaust names. The contents of /DK/ are not updated (need to rename files and
redraw the keypad picture) but parsing looks good.
  It looks like fiddling with xterm is not needed; gnuterm generates usable
  sequences too. I will need to figure what to do about different keyboards.
  Might have to use F keys, not aux keypad, to work on many laptop keyboards.
  This does not limit what can be done, just makes it necessary to remember
  more. A preload command file might help.
2/3/2019: minor changes, checking parsing. Redid zip file to put everything
  in "analybld" directory, similar to other packages.
  2/5/2019: Used debugging version to get what command files in /DK/ go with
  which keypad or function keys. The file "vt100codes.txt" has this
  information. Now it will be feasible to set these up and draw a keypad
  diagram to handle functions that should be provided by f key. Next can come
 also a function or two to implement pivot tables function.
2/7/2019: added vt100codes.txt and dkfilefuncs.txt files to describe respectively
 what different function keys call (what filenames are called, in /DK/ directory
 preferably), and what the existing files in /DK/ are intended to do as far as
 I can recall. These are necessary preliminaries to making up a set of
 such files, devising a keypad diagram of them, and incorporating that diagram
 into the help file PCCHELP.HLP. Adding a pivot table command file should be
 in there too.
2/10/2019: Added descriptions of additional functions to analyticalc.txt file.
Would have added to analyticalc.rno and processed, but I don't have easy access
to a Runoff text processor at the moment. To get one I would need to use simh
to set up a pdp11 or vax running RSX or VMS, or another emulator to set up
an alpha based VMS, then run Bonner Lab Runoff on RSX, or Digital Standard Runoff
on VMS. For now I will just edit the text file, adding in descriptions of
other functions in sections just before the index. 
This is a bit ugly, but at least it gets all the bits and pieces of descriptions
into one file as a manual. (There are abstracts and "quick reference card" files
which are not merged.)
2/19/2019: Added descriptions of how to handle pivot tables. While this can be done
by adding a function (decsribed) the functions already exist in the RIM database
which is built in. Worked on documentation of RIM so Runoff processor is not needed
to read its manual. You get pivot type functions by pulling spreadsheet rows into
the database in bulk (there's a single command for this), doing selects and whatnot
as needed, then possibly exporting database rows back to the spreadsheet, or using
RIM facilities to exhibit desired numbers.
2/22/2019: Added PIVOT function to a copy of analy.for (analypivot.for) which is as
described in the doc on pivot. Would look like
PIVOT label,label,label;value:value,upperleft of input area,number-rows,upperleft-output-area

where label columns are column numbers (pure numbers) that may be categories for
rows, value numbers are column numbers that have values (lowest to highest, no
limit on how many may be there). Number columns get summed for all cases where
all label columns match, and results get stored in saved area.
This is coded, but NOT tested at this point.

2/28/2019: Found a bug in saving spreadsheet formatted due to the much
enlarged number of display columns. Fixed and made sure that few enough widths
will be saved that if column parameter JDMCOL grows too much, program won't
save more than 200 or so display column widths. (They can always be reset,
since they are just display stuff, don't affect computations.) Still debugging
pivot command stuff, which will use keyword QPIV, not PIVOT, because any
command starting with P gets treated as a variant of Put command. Old code...

3/5/2019: QPIV function now is included by default. It passes an initial function
test, still needs more testing. However it seems to work at least partially.
I doubt it will be used much, has reminded me of much about the internal functions
in the program that I had forgotten. An annoying internal glitch is that 
the reflec routine is (row,col) arguments and pretty well everything else is
(col,row). (Don't know any exceptions.) This can get to be a PITA but only
for those venturing to add internal code. To copy a cell you need to use
fvldst and typset to set validity and type (integer or float), use xvblst to
set the value of the number, and call wrkfil to fill in the formula and flag
bytes after it. Note a format of just A will always display text, not values,
which is at times useful.

3/6/2019: Added RZ+ and RZ- commands, doc in analyticalc.txt. Normally 
Analyticalc will relocate cell names when copying with name relocation, if the
cell being relocated is down and right of the cursor, and above and left of
the relocation boundary (if it is set). RZ+ allows relocation to work regardless
of these limits, and RZ- returns things to the default. The RZ- state is default.
3/10/2019: QPIV command passes another test, no longer visibly fails. Not
tested a lot yet but main functions seem to work. Adding description to
analyticalc.txt.
3/26/2019: Tested another QPIV configuration, which looks ok. Added helpbld
program to make PCCHELP.HLP file used online and edited the help file.
Somewhere there may still be a flaky crash in QPIV which I cannot get to
reproduce itself. Function needs a whole bunch more test cases to see if I can
smoke this out. Other stuff looks fine and the F keys F5 to F12 except F11
seem to get their command files properly.
3/27/2019: Added a test at the end of subroutine reflec to ensure the index
returned is ALWAYS in range 1 to MRC (biggest subscript supported for actual
storage) to ensure whatever happens, it can't go pointing off into space and
crashing. Other places all in the end call reflec to get down to a real address
for storage, and this will just clamp illegal values to use the highest address
even if somehow a negative value got in...or a zero one.
3/29/2019: added regreg.cmd to DK files, which can be renamed to one of the
files for F keys to copy a 2D range to another 2D area. Also made analypivot
source have the crash-guarding change so it remains useful for debug later.
3/30/2019: Edited dspsht routine to allow display widths of 332 characters
rather than 132 which was from old lineprinter limitations and the most a
VT100 could display. Thus on a large x terminal you can see quite a few more
cells at one time. The choice of 332 was entirely arbitrary and perhaps would
have been better making a named parameter in aparms.inc but this makes things
a tad more useful.
4/2/2019: Fix an old problem with common variables so uvt100 routine can see
current display cell coord as cells, enabling VC mode to color negative cells
as red if VC mode is in effect. No effect on other display modes or on
functions, just gives a pretty way to see which cells go negative. 
This was a regression since I don't recall when.
5/5/2019: Edit the keypad file and get it so it matches command files for area
copy. Added a generic area to area copy for 2D areas (which needs more tests).
The old cell/row/col to area functions are there, work, and labelled properly.
Many fewer functions are keypad functions now, mainly by not documenting extra
ones because they can be reached by one or a tiny number of keystrokes without
messing with function keys. The area copy stuff is the only unique stuff and
that is in keys that work in xterms.

