AnalytiCalc Tutorial Using a spreadsheet is not always easy the first time, and the AnalytiCalc spreadsheet is no exception to this. With some practice, however, it's possible to become proficient in using its basic commands. This tutorial is dedicated to giving you some practice with a simple problem of wage calculations using AnalytiCalc which will lead to some facility using it. We will assume AnalytiCalc is already installed on your computer and that it may be started by giving a command "ACALC" at the console. Now let's consider the problem: Assume you're a group leader in a company and want to be able to print out your total labor costs per week for a group of a dozen or so employees. You know the labor costs per hour for each employee and the number of hours worked on this particular group's work by that employee that week. You want to have a total cost for each employee, and an overall total cost per week. You'll enter the hours worked, and the labor cost, and get the total. Then you'll print it out. To generate this figure, we'll have to design a simple sheet and print it when filled in. So let's get into the spreadsheet now to do so. Remember that in all commands (except direction arrows) you must type a RETURN after the command to complete it. This is not specially illustrated in the examples here but is always necessary, just as it is for most other commands you give to the computer. Until you press RETURN, you can use the DEL key to wipe out characters. You type: TYPE AUXKPD.TXT (optional; omit if your AUTOEXEC.BAT did so) ANALY (or whatever starts AnalytiCalc up) The sheet will load and print its first screen, announcing its presence and authors, and will ask a few preliminary questions. The first of these questions is: (after you tell it how to access the screen) Enter new numeric format default [Y/N]: The default format is F9.2, which is FORTRAN-ese for floating point numbers with 9 total digits displayed and 2 decimal points (appropriate to use for dollars and cents). This is likely to be OK for this project. If we wanted, let us say, 10 digits total (counting the decimal point) with one number to the right of the decimal, a format like F10.1 could be used. But we won't do that here. (Numbers are kept to 16 digits precision internally; we're only talking about how much is shown of that.) So we reply. Type: N AnalytiCalc will then ask for a title: Enter Title of Spreadsheet> This is just a title, any 80 characters or less. You can put in any desired text here and it will appear at the top line of the screen and of any printouts of the screen you make later. Just enter a descriptive phrase: Weekly Labor Expenses Summary Now AnalytiCalc must set up its working storage. It is a disk backed system, and can use disk storage for formulae and values, using 2 scratch files for the purpose. It will first ask how much of the sheet you expect to use, to give you an idea of storage requirements. It asks for the number of rows and columns that will be used: Enter number rows to be used: For this purpose, reply with 20. The program will then ask Enter number columns to be used: Again reply with 20. Now AnalytiCalc prints out the number of K bytes storage that will be needed at minimum to completely fill this area. However, it has sufficient storage internally for 800 cell values and for about 33 characters formula apiece, so just answer 1 to its queries about how much space to allocate. The answer of 1 will get it to use internal storage only, not disk: Enter size in K of value file>1 Enter size in K for formula file>1 The spreadsheet is now ready to run and will draw the calculation screen after a brief initializing delay. You now have a screen which displays something like 7 columns and 20 rows, with the columns labelled (initially) A, B, C, D, etc., and the rows labelled 1 through 20. Your sheet is normally larger and not all of it fits on the display at once. Thus, you can move around it and see parts initially not obvious to you. In each cell (row-column intersection) of the sheet (and the screen), you can put a formula, a number, or text. A cursor (a reverse video block) will move around the screen indicating the present active location. When you enter this information, it goes into the cell pointed to by this cursor. Move the cursor around by using the arrow keys. Note the cursor moves in the direction of the arrow keys so long as it can while staying on the screen. If you want to move past the edge of the screen, you do it with a different command. The screen cells are called by the column letter and row number, using names like A1, B5, R3, A18, or others. The next column after Z is AA, then AB, and so on. There is no logical limit to the number of characters usable for columns, but there IS an installed limit, usually 60 columns for PDP11 and potentially anything for VAX. If you want to see, let us say, columns L through R, you use the command: OA L1 which resets the screen to make L1 appear at its upper right. Any cell can be made the upper right. (Actually, every cell displayed can point to an independent part of the worksheet, but we won't do that here.) Now to return the display to the initial one (the upper left part of the entire sheet), issue the command OA A1 and things will be replaced. To move the cursor to the upper left cell, also issue the command L A1 which moves the cursor to cell A1 (and this command can move the cursor directly to any named cell, EVEN IF THAT CELL IS NOT CURRENTLY BEING DISPLAYED, though if it isn't displayed you can't see its' value). You'll note the commands are always entered on the next to last line on the screen, and the last line has some mysterious contents so far. The last line actually always displays the formula or text in the current cell. Now that you've seen the way we move a cursor around, we must design the spreadsheet screen we'll use to work your problem. Let's have 8 columns which we'll label EMP NO, RATE, MON, TUE, WED, THU, FRI, and TOTAL. The "EMP-NO" columnn will just have and employee number (for identification), the RATE colunm will have rate per hour for this employee, and the MON-FRI entries will have hours worked those days. The TOTAL column will then be the product RATE*(MON+TUE+WED+THU+FRI). To enter this information, we need to set our screen up to display 8 columns, 20 rows. We also want (let's say) only 8 characters wide in column 1 and only 8 in column 2, 3, and 4, and the rest stay as they are (default width 10). First set up for 8 columns, 20 rows: DB 8,20 Then set column 1 to have 8 characters: DW 1,8 Then set column 2 to have 8 characters: DW 2,8 It would be easier just to set up all the columns to have 8 character width, so we'll do it here. Type S The program will now ask: Alter display windows [Y/N]? Reply with a Y (Yes) response. Now the program will ask: ENTER NEW GLOBAL COLUMN WIDTH, 1-120: We want 8 characters wide so type 8 followed by return (the return key). The program will now ask: Reset display to Upper Left of sheet [Y/N]: Reply Y (though it doesn't matter here; the display is already set that way). Now the program again asks whether to enter a new floating point format default. Let's set the default for the new 8 character width, so type a Y here. The program will now print Enter new format. Suggest F10.2> Since we want Floating display, 8 characters wide and 2 decimal points, reply with F8.2 and the program will accept it. Now the program again asks for a spreadsheet title, so again type Weekly Labor Expenses Summary This will cause the screen to be redrawn. Notice that the columns are narrower now. The displays on these columns need to be in a narrower format so they'll fit. Although we don't really need to do any further work since we set up a new default, do so for a couple of columns anyway to see how it's done. Set the numeric columns (2, 3, and 4) up for numbers 7 digits wide with 2 decimal places: DF B2:B14 [F7.2] DF C2:C14 [F7.2] DF D2:D14 [F7.2] Now the screen has the widths we want. Enter the labels. Since we're already at the top left, just start: Type: E EMP NO which will leave column A1 showing the text EMP NO and this will appear at the bottom of page. Now use the right arrow to go to cell A2 and type: E RATE which should leave cell B1 containing the text RATE Now move the cursor to cell C1 with the arrow keys (you can use the 3 command instead if need be). Moving the cursor this way is tedious where there's a lot to enter, so let's set the program to do it automatically. Since the commands 1, 2, 3, and 4 mean also to move up, down, left, or right (which makes sense on a VT100 keypad since the layout of the arrow keys is in that order there), we'll use the command M4 to set the program to move right automatically after an enter. Type the command: M4 Now go ahead and type commands: E MON E TUE E WED E THU E FRI E TOTAL You notice the top row is now full of label information and the cursor should now be sitting at cell H1 on the TOTAL column (since the auto move can't change the settings of what is to be displayed on the screen). At this point, we can move down and enter the one formula we need for each employee. Type the command: L H2 to move to cell H2 (which will be the first numeric total area below the label). Enter the desired formula now. We use normal parenthesized expressions, with cell names representing values there. Thus, the formula will look like this: Type: E B2*(C2+D2+E2+F2+G2) Notice that a .00 appears rather than the formula, though the last line shows the formula. This means that AnalytiCalc knows it was a formula or number rather than text. Its' rule for this is that if what's entered contains any of the characters ".", "+", "-", "(", or "[", it's numeric and gets displayed with the default format (unless the format is changed with the DF command) and otherwise it's text. If what you enter has any of these characters in it, you can force it to be text by including a '"' character in the text somewhere (usually after a lot of spaces so it won't show on a display). You now have the formula on the first of the individual total lines, but you need to enter one like it on lines H3 through H14 (since there are a dozen names on the list). Fortunately, you needn't retype the formula. We'll copy it and relocate all entries. Since entries aren't relocated above or to the left of the cursor, do it while at A1 so all numbers get relocated. Type the following commands: L A1 CR H2 H3:H14 V This moves you to A1, then copies H2 to the range H3 through H14 inclusive with Relocation (changes all B2, C2, D2, ... to B3, C3, D3, ... and so on). The V command redraws the screen, since AnalytiCalc will avoid redrawing cells whose value didn't change (and these cells' values didn't just yet). Now you need a total for all of them. Let's make cell A15 be the label for the grand total and put the text "ALL" in it, and make cell H15 have the sum of H2 through H14. Type the following to arrange this: L A15 E ALL L H15 E SUM[H2:H14] Note that the SUM function greatly simplifies entering the sum of a whole column (potentially, it simplifies sums of rows too). We could have used it in the initial formula by making a multiple statement formula in row 2 which would have been like this: SUM[C2:G2]\%*B2 in which the "%" refers to "the result of the previous computation". This style of multiple statement formulas can save numerous cells and is the easy way to write formulas. The "\" character delimits statements. We have to do it like this because the multi-argument functions like SUM can't be combined into longer formulas in any other way. (We could have written the for- mula as SUM[C2:G2]*B2 if we liked, but this displays the multi- statement capability.) Now we have a complete set of formulas on the screen and are ready to start entering data. Enter a few dummy employees information to see how the computation goes. Notice that the totals are updated at every entry. (From this point, it's simple). Enter commands as follows: (NOT the parenthesized comments) L A2 E 11111 E 12.55 ($12.55/hr) E 7.5 (hrs Monday) E 8.0 (Hrs Tuesday. Note the required ".".) E 8.0 E 8.3 (Hrs Thursday) E 8.0 (Hrs Friday) L A3 E 12222 (Emp # 12222) E 17.50 E 8.0 E 8.0 E 8.0 E 7.5 E 8.0 By now, you notice something: most of the hours worked are 8.0 per day, with occasional exceptions. Your life would be easier if you could just fix the exceptions and enter the 8.0 entries en masse. This isn't too hard. Use the following commands to enter 8.0 in all remaining hour fields (columns C through G, rows 3 through 14): L C4 (Move to cell C4, the first to set) E 8.0 (Enter desired value) CA C4 D4:G4 (Copy so now C4 through G4 have 8.0) CA C4:G4 C5:G5 (Copy to next row. Note no relocation needed) CA C4:G4 C6:G6 CA C4:G4 C7:G7 Now you see that we are repeating ourselves. We COULD go on and type: CA C4:G4 C8:G8 CA C4:G4 C9:G9 CA C4:G4 C10:G10 CA C4:G4 C11:G11 CA C4:G4 C12:G12 CA C4:G4 C13:G13 CA C4:G4 C14:G14 but we won't. Instead, we will let AnalytiCalc do the copying for us. Type the Alt-F6 key (for copy row to area). The program will churn a bit and eventually ask you: Give Start Cell of Row> Reply with C7 (i.e., just type C7, since that is the leftmost cell of the first row, which is assumed to be where we are copying from). The program will then ask you: Give End Cell of Row> Reply with G7 since that is the rightmost cell we are copying from and defines the right edge of the area we copy from. The program will then ask: Give Bottom Left of Left Column> Reply with C14 since that is the lowest area we are copying to. The program will now perform the copying for you. When done, it will return to wherever you were when you started. Now the cells all contain the 8.0 entries desired and we can fill in the rest of the desired data. Since we can do this moving vertically, enter a command to move down on enter: M2 Now go to cell A4 and enter the remaining employee numbers: L A4 E 13300 E 14400 E 15500 E 16600 E 17700 E 18800 E 19900 E 19911 E 19922 E 19933 E 19944 Now these cells are set up. We need only fill in rates and the entire sheet will be set up properly: L B4 E 11.56 E 12.0 E 21.4 E 8.55 E 15.32 E 16.0 E 17. E 6.78 E 17.35 E 22.50 E 24.35 We now have a full screen and the TOTAL column shows labor costs as desired. Suppose the last employee only worked 7 hours on the Thursday: We now just go to that cell and change the value: L E14 E 7.0 Now the sheet is updated. You now will probably want to print this to get a hard copy. To do so, just type W AnalytiCalc will reply with the request: Enter print file spec., / after to omit borders> Give the name of a suitable file on disk or a printer that your system understands. A suitable reply for the PC would be just LPT1: which will print the sheet. The program will churn for a few seconds and your printout will be on the printer, a copy of what's on the screen (with some extensions: if on PC you tell it to display 75 rows, they won't be able to be on the screen, but they'll print). The same holds for width. You can set the number of columns up to more than fit on the screen (using DW to set widths of individual columns and/or DB to set the number of columns (and rows)) and up to 132 characters across can be printed. (This is as much as most printers can handle so no more are provided for.) If you need to suppress the labels, follow the filename with a / character (e.g., LPT1:/) and to also suppress the title line, follow with a % character (e.g., LPT1:/%). This is done to make it easier to obtain files that can be pasted together. Since you may need this next week too, with some mods for hours, it's a good idea to save the sheet. Here's how that would look to save the sheet all in a file called WKLYHRS.PCC L A1 PPX Enter filename>WKLYHRS.PCC Enter max displ down to save or 0>0 Enter max displ right to save or 0>0 (This includes AnalytiCalc prompts too: you enter the filename and the zeroes (meaning the whole sheet) to save it all.) Notice we went to cell A1 first. That's because sheets are saved from the cursor down and right. This way we get it all. Now just for fun, let's try this again. Use the X command to exit. X The program will ask you "Confirm Exit Request [Y/N]: to which you reply Y to really exit. This is a safety feature. A message is printed on the bottom of the screen prior to exit warning that exiting may lose data unless the sheet has been saved. This is just a caution. Now run through the initial Analy load again and get another blank spreadsheet screen again. We'll load the saved one in. Now we will assume you are sitting with the cursor on cell A1. First we have to set up the screen as before: L A1 DB 8,20 DW 1,8 DW 2,8 DW 3,8 DW 4,8 Or alternatively, give the S command and reset the global width to 8 as before. The DB 8,20 (for 8 columns, 20 rows) will still be needed. Now we load the saved sheet into memory. L A1 GP Enter filename>WKLYHRS.PCC Enter max displ down to restore or 0>0 Enter max displ right to restore or 0>0 Enter min displ down>1 Enter min displ right>1 The program will churn awhile and your original screen will reappear. Note the prompts allow you to save or restore any rectangular region. Saving and restoring are done relative to the cursor, so start from A1 always unless you are merging multiple sheets into one larger one. In that case, beware of formula changes too. You will want to use the GPR command to relocate multiple sheets together into one; see the manual for some description of that command. Notice the display formats were saved and restored. Now that you have your saved sheet in memory, suppose someone has been hired into your group and you need to add another line to your list. This isn't too hard. You use the AR command to add 1 row with formula relocation. If we want the line to go in above row 14, the way the commands look is thus: L A14 AR 1R Now you'll notice that row 14 and row 15 are identical and the same as the old row 14. What's happened is that row 14 was moved down, so what was row 14 is now row 15, and row 14 is free to use. However, since it still contains its' old contents, we can use the fact that all the 8.0 entries and formula entries are there and correct, and just set up the new employee number and rate, and we're done. The commands to do this might look like: L A14 E 23541 L B14 E 12.75 ($12.75/hr for this employee) so now the sheet is again correct (apart from changes from the 8 hour daily hours anywhere). If this sheet is to be saved, another PP is needed. Note that if you use the same filename as you did before, the new saved sheet will OVERWRITE the old one. To exit, type X which exits from the sheet. Reply Y to confirm you really mean it. Additional pre-exit operation: Suppose you want a report that won't show the RATE column directly. This can be arranged by just setting up a screen display that does not contain the B column. This is easiest to set up with the OR command, which sets up what part of the screen is displayed from the cursor down and right. We have to reset column widths of column 2 also, so it will be 10 again. The commands to set the screen up are like these: OA A1 DB 7,20 (We only need 7 columns) L B1 (Move to 2nd column) OR C1 (Set so we see column C there instead) The screen now shows colunns A, C, D, E, F, G, and H and may be printed with the W command as it appears. Note that 20 rows will appear. Had we wanted to see only the 15 or 16 rows filled in, we would have used a command like DB 7,16 above. Had we wanted not to have row and column letters and numbers on the printout, using a / after the name of the file in the W command does this. The file, if it goes to disk, may be edited by any system editor or word processor, however. For further instruction and commands, the system help command is invoked by typing H (optionally followed by a digit 0 through 9). The F1 key on the IBM PC is also set to be equivalent to the Help 0 command. Most commands are briefly described in help pages. The system manual (AC.MAN) is also supplied machine readable and may be browsed in online via any of several public domain utilities which can examine files a page at a time. The $command form of command to AnalytiCalc allows you (if you have enough memory) to fire up any command known to DOS after the $ and return to the sheet when the command terminates. There is an alternate keypad function set which should be examined. If your version of AnalytiCalc supports it, the H9 command will display a diagram of the functions available via the auxiliary keypad on the screen. Just type H9 (or ALT-F1) and the picture will appear if available. GLOSSARY The following commands are used here: Command Means L cell Locate cursor at cell OA cell Origin Absolute - make cell be upper left corner of display OR cell Origin Relative - make cell be where cursor is (i.e., relative to cursor) DB ncol,nrow Display Bounds - make display have ncol columns and nrow rows on screen DW col,width Display Width - Set display column "col" to width characters wide. Use the numeric display column numbers at top of screen to specify column on display. DF cell-range [format] - Display Format - set cell range to have display format for numbers. Any FORTRAN format is legal (up to 9 characters of format spec.) and if just [A] is specified, cell displays formula text entered in it, not number. Cell range can be 1 cell name or 2 cells separated by colon (e.g., B2:G2). Ranges must lie in a row or column. E text Enter - Enters text into a spreadsheet cell. If the text includes ", or does not contain one or more of ".", "(", "+", "-", or "[", then it is treated as TEXT and the text is displayed. Otherwise it is treated as numeric and the numeric value is displayed. The DF command changes which is shown. Numbers MUST contain . characters to be handled correctly. V View - Redraws screen, forcing display to be correct. R Recalculate - recomputes sheet. (Normally not needed since recomputation is automatic. Best to issue this command as RXF to speed it up.) Mn Auto Move in direction n, where n=1,2,3, or 4 for up, down, left, or right (M5 means no auto motion), AFTER ENTER. This sets up automatic motion after Enter commands. 1,2,3, or 4 Move cursor immediately: or arrow keys Move immediately in the arrow direction or in direction up, down, left, or right respectively for 1 through 4. W Write - Writes out screen contents to a file or device (e.g., the printer) on your system. Produces human readable files, suitable for editing into documents. PPX Put Physical Symbolic - Saves spreadsheet info in a special format for later read-in, saving all formulas. (Note PPN saves numbers only (for graphs) and throws out formulas.) Saves down and right from cursor, amount saved depends on your command. Files are ASCII but not intended to be read by humans. PDX saves display sheet within bounds, not taking bounds or save order from physical sheet but from how it's rearranged on display screen. Either form can be restored either way. GP Get Physical - Reloads special file from a Put command into current sheet starting at cursor and going down and right. An offset from original save may be specified in both horizontal and vertical directions and partial restores are possible. This permits merging sheets. Hn Help - Puts up help pages. There are 10 pages of online help, numbered 0 through 9. H8 brings up page 8, H0 (or just H) brings up page 0 which is an index into the rest. PF2 on VT100's acts as a H command. You may issue further Help commands once in the help system. A return will return you to the sheet. X Exit from the sheet and do NOT delete the workfile XD Exit and Delete - exits from PortaCalc and deletes the workfile. This is the recommended approach unless the workfile is nearly totally full, in which case it may be smaller than the file generated by PP commands.