Outside Function Calls: SCIFCT Adding new functions to AnalytiCalc can now be done without modifying them. This will permit you to add practically any functions desired to AnalytiCalc, provided: 1. They must be Fortran callable, and 2. Their arguments must be real*8 or Integer*4, and 3. They must make minimal (preferably no) use of data passed to them in Commons. Numerous functions in scientific and math libraries satisfy this. The [.STAT] subdirectory here supplies a few hundred examples which can be selected from. To implement these functions, you need to select what you want called, and add calls to the functions into the SCIFCT.FOR file here. This file contains 3 examples, one internal and two in the Scientific Subroutine Package (SSP.FOR). The external ones are documented in their source files and were selected because they do multiple linear regression and chi-squared calculations. The comments in SCIFCT.FOR will guide you in adding the calls. You have to add the function name, some flags for which arguments are integer, which real, which dummy scratch areas, and which are output arrays. To call a function in this file, if the function name is abcdef, your call in an AnalytiCalc formula is of the form *U STabcdef in1;in2;in3;in4;...inN>out1;out2;...;outN where inN is either a single cell or a range of cells. The caller is expected to know what the function requires. The SCIFCT file will ensure that enough arguments are present, and will convert the arguments to integer or float to match what the function (abcdef in this case) expects. The method is that arguments are copied from the spreadsheet into a scratch array whose dimension is a parameter in SCIFCT. Then the Fortran function is called with its argument list pointing to the appropriate place in the scratch array. On return, output arguments from the called routine are copied into the outN areas specified in the call in the spreadsheet. Therefore these may differ from the inputs. If scratch areas are needed, they are created on the fly and need only one cell in the call, PROVIDED their length is in an argument that appears earlier in the argument list. If you specify a bigger area than calculated this way for scratch arguments, it is used. A bit of extra slop space is added, too, to help avoid problems in this case. Output arguments are positional and start with the first OUTPUT argument of the subroutine. Null output arguments may be specified by just two semicolons adjacent, so that B3:D5;;H2 would specify the rectangular area whose diagonal ends are B3 and D5, a null argument, then the cell H2. If the argument between these is not an output argument, though, anything can safely be entered here; data is copied only to output arguments. It's up to you to document whatever you add, of course. There are enough subroutines presented here and available from other places to THOROUGHLY intimidate anyone who isn't a PhD level mathematician, and with a little work (I trust I've made it minimal) you can add literally hundreds of strange & wonderful functions to AnalytiCalc, to be available at your fingertips. If anyone does this for a bunch of these routines, I'd appreciate a copy (on tape please); I won't hold my breath. More to the point, if you have a calculation that you do a lot and want it added, you need not bother with changing it around to fit it into AnalytiCalc; just tack it in here. Just replace the file SCIFCT.FTN in the build files with SCIFCT.FOR and link with any extra objects you pull in. (You can just recompile SCIFCT.FOR and put it into PCCX.OLB if you like, avoiding a total recompile too.) The functions added may do other things like plotting, database queries, communications, open the garage door, etc. This facility can also be used to debug algorithms if you like; use the spreadsheet to enter data and build it with debug, so you can see what your subroutine is doing without having to write a lot of special driver routines. The subroutine name and the name in the *U STmmmmmm call do NOT have to be alike, and one *U STmmmmmm call can be used to call several subroutines if you want. Several of the routines in the Scientific Subroutine package are set up to be used this way. Enjoy. Glenn Everhart 25 Sleigh Ride Rd. Glen Mills, PA 19342