DATACALC! Datacalc is a genaral purpose spreadsheet type program for use on the ZX81 with 16K RAM. When loaded the program will run automatically and display a menu asking you to enter a 1 or a 2. 1 gives you the sheet that was saved. It will actually give you error code 2/1045 if only the program was saved. Entering 2 asks you for the number of rows to be used, followed by the number of columns. Enter 10N/L and then 10N/L. This should give you a display showing 10 rows and three columns on the screen, with a flashing cursor in the top left hand corner. To demonstrate the use of the program I shall use a simple example showing the calculation of profits on a range of products sold by a shopkeeper. To enter column 1 as shown in figure 1 press the key K. The screen blanks out for a short time and then returns with the cursor fixed in row 1 of column 1. Now enter a space ' ', this blanks out the zero that was there. You will notice that the cursor has moved down to the next row ready for you to make the next entry, so now enter 'PRODUCT' N/L. To underline all of the headings enter '---------:' N/L. The ':' at the end tells the computer to enter this same string into each column along the row. Now enter each name in turn. To prevent errors in calculation later on the computer needs to be told where headings and titles are. In the case of titles these can only be put into column 1 anyway, so to tell the computer you are using column 1 for titles press T for two or three seconds. The headings can take up as many of the top rows as you like, so to tell the computer where they finish, move the flashing cursor down to row 3 by holding down the 6 key and then press H. To enter the next column move the cursor using the cursor keys to column 2 row 1. Now press 'A' followed by the word 'SALES', then move cursor down to row 2, press 'A' again followed by the the word 'VOLUME'. Now press 'K' and enter each of the values in turn. You will have noticed that the cursor moved automatically to row 4 after pressing 'K'. This is why the 'A' command was used to put in the headings. 'A' is the command used when entries are made into individual cells. Anyway repeat the above procedure to enter headings and data into column 3, then by holding the 8 key down the sheet will be re-written to bring column 4 onto the screen. After filling in the headings press key F. The computer will now be waiting for you to enter a formula. A formula in Datacalc can take several forms. In this case we want to multiply the Sales Volume by the Sales Price to get the Turnover for each product. This is to say that we wish to multiply each value in column 2 by its corresponding value in column 3. The formula used to do this is 'K2*K3'. To find the total Turnover for all the products we need to add together all the individual values in column 4. To do this simply press 'S'. We can move across the sheet by more than one column at a time by the J command. For example we need to enter figures into column 5 next, so press 'J' followed by 5. The sheet is now re-written with columns 5, 6 and 7 on the screen. Before doing anything else put in the headings for these columns. Before moving back to column 5 to enter the cost figures it would be rather nice to have the products listed down the screen to see which product the cost referred to, so use the J command again to get the screen toshow columns 4, 5 and 6 - that is 'J' '4' N/L. Now press L. This overprints the first screen column with column 1. Now use the K command and enter figures into column 5. Move the cursor to column 6 now and press 'F' again ready for entering another formula. This formula is to calculate the total costs which is the cost of each multiplyed by the sales volume i.e. 'K2*K5'. Enter this formula and then use the 'S' key. Now move cursor to column 7 either by keeping the cursor pressed down or by using the J command and after putting in the heading enter the formula 'K4-K6' to find the project for for each product. Use S again to find the total profit. Finally move to column 8, put in the heading and press 'F' to enter the formula for percentage profit. What we will be calculating hereis what percentage of the total profit each individual product makes. Now total profit is the sum of all individual profits and is the figure at the bottom of column 7 calculated by the S command. The formula to be entered is 'K7/S7*100'. To demonstrate the SORT command put the cursor on column 8 and press 'O'. The computer will sort on column 8 and rearrange it into assending order - that is lowest figure at the top. All the other entries along a given row are also moved into the new order at the same time. Use the L- command again to print the product names. Now move the cursor back to column 2 and position it over the 1.000 figure for the Jigsaw, press 'A' and put in a new value, say 1.450. Now press 'C'. This will re-calculate the whole sheet. If you move back to column 8 you will see that all the values have been changed slightly and need re-ordering, so press 'O' again. To tidy up the display press the 'M' key. _____K1________K2________K3_______K4________K5_______K6_______K7________K8_____ 1 " SALES " SALES " " COST " TOTAL " " PERCENT 2 PRODUCT " VOLUME " PRICE " TURNOVER" EACH " COST " PROFIT " PROFIT 3 ---------"---------"--------"---------"--------"--------"---------"--------- 4 JIGSAW " 1000 " 13.00 " 13000 " 11.00 " 11000 " 2000 "9.8522167 5 BANDSAW " 200 " 70.00 " 14000 " 57.00 " 11400 " 2600 "12.807882 6 BENCH SAW" 700 " 35.00 " 24500 " 31.00 " 21700 " 2800 "13.793104 7 DRILL " 1500 " 15.00 " 22500 " 13.00 " 19500 " 3000 "14.778325 8 ROUTER " 1100 " 20.00 " 22000 " 17.00 " 16700 " 3300 "16.256158 9 SANDER " 1300 " 18.00 " 23400 " 15.00 " 19500 " 3900 "19.211823 10 TOOL BOX " 900 " 7.00 " 6300 " 4.00 " 3600 " 2700 "13.300493 ------------------------------------------------------------------------------- 125700 105400 20300.00 Figure 1. It was mentioned earlier that a formula can take several forms, and we have used one of those forms when we multiply 2 columns together, for eksample 'K2*K3'. You can also use it for calculations of the type (27.5*6)-5 or ã*17/4, in fact any of the computers own functions can be used; for example INT(ã*30) is quite valid. An interesting variation is achieved however, if the letter R is used in a formula. Now R is the variable used in the program to denote the row number. If R is used on its own it will result in the row number being printed in each row of a column or if used in combination with some other function or number it can be used to increment; for example '10+(R*.1)' will progressively increment the value 10 by 10 precent. The reversal of this formula will of course decrement the value. R is therefore a powerful tool for loading data into the worksheet. Two other useful funktions are provided under the F command. If you enter the letter P as a formula you will get a progressive sum of the previous column. If you enter the letter I you will get the previous column inverted. _______________________________________________________________________________ Mode Command Description What is required Sub What they do next command ------------------------------------------------------------------------------- Menu 1 To enter ex- - - - isting sheet 2 To set up Enter number of - - new sheet. columns required ------------------------------------------------------------------------------- Cursor 5 Move cursor Holding down at - - left edge of screen 8 Move cursor will move sheet - - right along 1 column. 7 Move up - - 6 Move down - - ------------------------------------------------------------------------------- Main H Headings to be NB! Move cursor - - sheet used up to to the row where current cursor headings finish row. first. T Titles required NB! Text can - - in column 1. only be used in column 1. K*) To enter a Enter each figure N/L Cursor incre- column of or title in turn, ments one row, figures. cursor jumps to leaving existing next row after figures or titles entry. unchanged. A*) To add or Enter figure or R Returns operation amend an entry. title. to cursor mode. F Enter formula eg K1*K2 multi- P Progressively over current ply values in sums previous column. column 1 by column. values in column I Inverts values in 2. previous column. C Calculate the - - - whole sheet. J Jumps to Enter column - - another column. number to be at first position on screen. D Drop or rise. Enter row number - to be at top of the screen. S Sum of current - - - column. X Delete sum of - - - current column. M Rounds up deci- - - - mals to 2 places and aligns print- out on decimal point. L Overprints - - - column 1 onto first screen column. O Sorts current NB! All other - - column into columns follow ascending order. the sort. V SAVE existing - - - sheet. P Prints copy - - - of screen. *) By adding a ':' to a figure or title it will be repeted in all subsequent columns in current row. Figure 2.