.TITLE PortaCalc - A Public Domain Spreadsheet .PAPER SIZE 80,80 .SPACING 1 ^^ .C PortaCalc - A New (Free) DEC Spreadsheet .SKIP 2 .C by .C Glenn C. Everhart .SKIP 1 .P People wanting to use a spreadsheet on their PDP11 or VAX based systems now have a new choice. In the past, the only spreadsheets available either were very costly (some over $4000) or ran on microprocessors (possibly emulated under RSX or VMS). .P Now there is a spreadsheet program, written in FORTRAN 66 for portability, which has been submitted to the DECUS Program Library for use with PDP11 and VAX, which has all the functionality of the commercial products, but is available essentially free and in complete source form. It runs under RSX, or on VAX VMS in native mode. Versions for RT11 and DEC20 are being worked on also, based on the RSX/VMS version. If either effort produces a working program, it will be submitted to DECUS also. This system was christened PortaCalc because its source language is chosen to make it easy to port to new systems and its use of DEC peculiarities has been minimized. (Porting it from RSX to VMS took half an hour.) .P The PortaCalc program took about 2 weeks to write, debug, and polish since it is based on a program called Calc obtained from the DECUS library which was extended to handle the requirements of a full spreadsheet. Since the major part of the computing engine was in place, only multi-argument functions, command parsing, and display needed to be added. Also, since Calc is a Fortran 66 program, it is itself rather portable, and its capabilities have been retained and extended. (This means that PortaCalc has some really unusual abilities like working in non decimal radices - such as hex - or extending formulas infinitely by reading them off separate files where they won't fit in the space provided in the sheet itself.) Since originally put together, PortaCalc has been given most of the attributes of a simple programming language too, and a crude database handling capability. .P The command structure of PortaCalc is not like that of VisiCalc, SuperCalc, or other spreadsheets. Mostly, this comes from the desire to read in commands with simple Fortran READ statements which assume a RETURN after the text is entered. Thus, the commands are structured as _#_, where the verbs are short (1 or 2 letters generally). The commands do make sense, however, and there is an online help page to summarize them should you forget their syntax. .P PortaCalc is similar to many other spreadsheets in that it displays a matrix of cells on a screen (up to 132 columns wide) which map onto a larger number of cells kept in the computer. At each location, there is a number and a formula, either of which may be displayed. Display formats can be chosen from the entire FORTRAN repertoire and individual columns may be set to different widths. Each cell may have a different format for its output, and the default format may also be changed. Unlike some sheets, PortaCalc allows multiple equations in each formula. (You can even comment the equations.) Any cell can refer to a command file which can be used to add user defined functions, using any cells and having 27 accumulators available which can handle integer data, floating point data, or multiple precision data of up to 99 digits width. (You can use a built-in interactive calculator at any point while working on a sheet also, and return to the screen display after, if you need to make further computations outside of sheet context). Maximum sheet size is determined by parameters set at compile time so that it depends solely on memory available. On PDP11 a 40 by 32 sheet is generally used at our site (nobody has needed a larger one yet). On VAX, the size is essentially unlimited. The spreadsheet is of course somewhat slower than some commercial ones due to the HOL and the way it computes formulas. However it is usable, and recalculation can be done manually to remove that overhead where it is not needed. The entire sheet can be driven from command files, which are able to prompt the user for terminal inputs, perform conditional tests and looping, and control inputs. There is even interaction with the sheet so that a computation in any cell can be used to control the looping in a command file. There is a data extraction command in the embedded calculator which can query sequential files to dynamically extract numbers or formulas from predefined files which can be created and maintained with normal editors. Thus, PortaCalc is designed to be used with command files as well as from terminals. A knowledgeable user can program PortaCalc for a variety of applications. .P PortaCalc is unique in that every cell on the screen can (if desired) become a separate window onto the physical sheet. It is up to the user to determine what should be mapped. A pair of "origin reset" commands act as a fast scrolling operation for contiguous parts of sheets. The mappings set up onto the screen can be used in computation, so that they define a projection onto the physical sheet which can be summed over, averaged, etc. .P The PortaCalc sheet as supplied to DECUS presently supports VT100 terminals (with or without AVO), or VT52 terminals. Also there are versions of the UVT100 subroutine (which is the only screen access routine) for Datamedia Elite 1500 terminals and for Datamedia Colorscan 10 terminals. Additional support has been written for Televideo 925's and ADDS Consul terminals. The DECUS version will be updated periodically to provide these terminal support packages, but using any of the existing versions, it is a 30 minute job to make a version for your terminal. All that is needed is direct cursor addressing, plus a way to erase the screen and erase a line (on the ADDS Consuls, the line erase must be done by writing spaces). The program is also designed to be easy to recustomize for terminals with more than 24 lines. Versions for RSX11M, RSX11M+, and VMS are easy to generate with supplied command files, and all documentation is machine readable. Also supplied, in the hope that it will be helpful, is a document describing known features of the Fortran used (Fortran IV Plus) not part of the ANSI 66 standard. It is not complete, but will give a good start to people modifying the package for their own machines. .P Due to space limitations, PortaCalc does not have built in graphics. Rather, there is a separate program which reads saved sheets and can produce histograms or scatter plots of any parts of a sheet by name. Since one can save or restore whole or partial sheets, or restore partial sheets to different locations, these save files will normally be made anyway to simplify merging different sheets. The graphics utility can access these files. It, too, is available in source. The current intention is that data base access and word processing may be integrated by this route. The screen can be saved as a normal ASCII file, of course, at any time and that can be easily included in documents. .P The following are two pictures generated by PortaCalc of its screen and including the row/column labels. These may be suppressed if they are not wanted. The VT52 type cursor is added in by hand; the VT100 reverse video effect cannot be reproduced this way. .SKIP 2 .TEST PAGE 40 .LITERAL Demonstration of Appearance of a Typical VT52 Screen ROW/COL A= 1 B= 2 C= 3 D= 4 E= 5 1> General Priv. Inst. Expansion 100.000 100.000 100.000 100.00 2> SVC insts expansion 3000.000 200.000 3000.000 200.00 3> Interval Timer Service 500.000 25.000 500.000 25.00 4> Virtual Interval Timer Service 500.000 25.000 500.000 25.00 21> Virtual Timer Updates/sec 20.000 20.000 20.000 20.00 22> SVC's per Second 200.000 200.000 200.000 200.00 23> Average MIPs of MCF CPU 3.000 3.000 3.000 3.00 24> Time to init paging 0.050 0.050 0.050 0.05 25> Minimum Runtime Quantum 0.100 0.000 0.100 0.00 26> Total Inst Ovhd Time/Sec 3.158 0.602 0.608 0.09 27> Total I/O Time > 0.390 0.390 0.390 0.39 28> Total Wait Time 0.077 0.003 0.077 0.00 29> Total Time 3.625 0.995 1.075 0.49 5> Protected Memory References 500.000 25.000 500.000 25.00 6> I/O Interrupt Svc. 2000.000 500.000 2000.000 500.00 7> I/O Startup Overhead 6000.000 1100.000 6000.000 1100.00 8> Non-SVC Sensitive Insts 100.000 25.000 100.000 25.00 9> VMM scheduling ovhd 2.000E+04 1.000E+04 2.000E+04 1.000E+0 10> Time in Sched Wait Q 0.010 0.000 0.010 0.00 11> Device Wait Time 0.010 0.000 0.010 0.00 B 27> B12+B16*(B14+B15+2*B24) FIG. 1 - VT52 Screen, Numeric (default) Display .END LITERAL .TEST PAGE 40 .LITERAL Demonstration of Appearance of a Typical VT52 Screen ROW/COL A= 1 B= 2 C= 3 D= 4 E= 5 1> General Priv. Inst. Expansion 100. 100. 100. 100. 2> SVC insts expansion 3000. 200. 3000. 200. 3> Interval Timer Service 500. 25. 500. 25. 4> Virtual Interval Timer Service 500. 25. 500. 25. 21> Virtual Timer Updates/sec 20. 20. 20. 20. 22> SVC's per Second 200. 200. 200. 200. 23> Average MIPs of MCF CPU 3.0 3.0 3.0 3.0 24> Time to init paging .05 .05 .05 .05 25> Minimum Runtime Quantum .1 0. .1 0. 26> Total Inst Ovhd Time/Sec (B17*B8+B1(C17*C8+C1(D17*D8+D1(E17*E8+ 27> Total I/O Time >12+B16*(BC12+C16*(CD12+D16*(DE12+E16* 28> Total Wait Time B11+B13+B1C11+C13+C1D11+D13+D1E11+E13+ 29> Total Time B27+B28+B2C27+C28+C2D27+D28+D2E27+E28+ 5> Protected Memory References 500. 25. 500. 25. 6> I/O Interrupt Svc. 2000. 500. 2000. 500. 7> I/O Startup Overhead 6000. 1100. 6000. 1100. 8> Non-SVC Sensitive Insts 100. 25. 100. 25. 9> VMM scheduling ovhd 20000. 10000. 20000. 10000. 10> Time in Sched Wait Q .01 0. .01 0. 11> Device Wait Time .01 0. .01 0. B 27> B12+B16*(B14+B15+2*B24) Fig. 2 - VT52 Screen. Formula Display .END LITERAL .P Note that on the VT52, the ">" character indicates the cursor. On a VT100, reverse video is used instead, and the entire cell is shown in reverse mode. The formula of the current cell is always exhibited at the bottom of the screen if any exists. .P The documentation supplied is sufficient to use the sheet. However, a calculator from DECUS was used as the computing engine (which made writing the rest a 2 week job). Its documentation is also included, but not integrated with the documents for the spreadsheet. You'll need to examine both to discover which functions exist and can be used. Full "scientific calculator" functions exist, plus some statistical ones. Financial ones, however, are not (the necessary trick to add them by indirect files is mentioned in the documents though). Also, PortaCalc does not have a lookup function as such. Rather, it gives you a way to treat the entire sheet as a large array and access any of it computably. This is a similar but more general function, since it gives the ability to make 2 dimensional tables rather than just single dimensional ones. .P The PortaCalc program is already in use by DECUS staff internally, and will be available shortly from the library, though its' order number has not (as of 2/15/83) yet been assigned. Expected cost for order will be about $140 for the special collection tape containing all code, and possibly around $60 for the single program version which will leave off some extra goodies added to the original submission not related to PortaCalc. Earlier versions will appear on DECUS RSX and VAX SIG tapes for Fall '82, but users wanting the full version must order it from DECUS. (The VAX tape has Version 2 - the latest is V3B - which lacks formula editing, database access, and some of the command file driving niceties.) There are of course NO license restrictions. If you have RSX and desire file security, you may obtain the special collection and use the secure virtual disk package included therein to handle the security needs separately from this package; that driver is included in the special collection tape version of DECUS PortaCalc. VAX users desiring the same protection are advised to call Midcom (213-516-9590) and to ask about the encrypting virtual disk package they have. It's well worth their price.