Home  Articles  Programs 

SpeedCalc: For Commodore 64 And 128

In response to popular request, COMPUTE! presents this high-quality spreadsheet, program for the Commodore 64 and 128 (in 64 mode).

Written completely in machine language, SpeedCalc has the major features you'd expect from a commercial spreadsheet. In addition, its data files can be merged into text files created with the Speed Script word processor published last year in COMPUTE!. SpeedCalc requires a disk drive; a printer is recommended.

Upcoming issues of COMPUTE! will feature versions of SpeedCalc for Apple U-series computers (DOS 3.3 and ProDOS) and Atari 400/800, XL, and XE computers; SpeedCalc also will be available on the premiere COMPUTE! DISK editions for Commodore, Apple, and Atari computers.


Have you ever planned a budget for your home or office? If so, you probably used some sort of worksheet divided into rows and columns. Perhaps you wrote the months of the year along the top of the sheet and listed categories for earnings and expenses along one side. After entering data for each category and month of the year, you could calculate total income figures by adding or subtracting numbers in each of the sheet's "cells."

That's a classic example of a worksheet. It lets you enter and organize data, then perform calculations that produce new information. A spreadsheet program is an electronic version of the familiar paper worksheet. Since it does all the calculations for you at lightning speed, an electronic spreadsheet is far more convenient than its paper counterpart. And spreadsheet programs also offer built-in editing features that let you enter and manipulate large amounts of data with a minimum of effort.

SpeedCalc is an all machine language spreadsheet program for the Commodore 64. Though relatively compact in size, it's fast and easy to use, and has many of the features found in commercial spreadsheet programs. Even better, the "SpeedScript Integrator" program (also included here) lets you merge your SpeedCalc files into word processing documents created with SpeedScript, Compute!'s popular word processor (see COMPUTE!, March 1985, or SpeedScript for the Commodore 64, published by COMPUTE! Books). Working together, SpeedCalc and SpeedScript make a powerful team. You can merge a chart of sales figures into a company report, create a table of scientific data for a term paper, and manipulate numeric information in many other ways. In a sense, a spreadsheet program brings to arithmetic all of the flexibility and power that a word processor brings to writing.


Preparing The Program

Although SpeedCalc is small in comparison to similar commercial programs, it is the longest program COMPUTE! has ever published. Fortunately, the new "MLX" machine language entry utility makes it easier to type a program of this size. Be sure to carefully read the new MLX article elsewhere in this issue before you begin. Since this latest version of MLX was first introduced in last month's issue, you'll need to read the new article even if you've used the old MLX many times before. The SpeedCalc programs must be entered with the current version of MLX.

Here are the addresses you need to enter SpeedCalc with MLX:

Starting address: 0801
Ending address; 2680

Be sure to save the program at least once before running it for the first time. Though it's written in machine language, SpeedCalc has been designed to load and run just like a BASIC program. Simply enter load"program name",8 then type RUN.


The SpeedCalc Screen

SpeedCalc uses the top line of the screen as the command line. This is where SpeedCalc displays messages and asks you questions.

Screen lines 2-4 are the input buffer area. This is the work area where you enter and edit data. As you'll see in a moment, the input buffer also displays the data contained in the current cell.

The lower 21 screen lines are your window into the spreadsheet. Though the spreadsheet contains many rows and columns, only a few can fit on the screen at a time. By scrolling the screen back and forth with the cursor, you can move the display window to any part of the spreadsheet.

The SpeedCalc worksheet consists of 50 vertical columns labeled with letters (AA, AB, AC, ... BX) and 200 horizontal rows numbered from 1-200. The intersection of a row and column is called a cell. Cells are where you store data. With 50 columns and 200 rows, the SpeedCalc spreadsheet has a maximum of 10,000 (50*200) cells. Due to memory limitations, however, only about a third of these can actually contain data. But you may spread out the data over all 10,000 cells if necessary, depending on the format you need.

If you don't like the spreadsheet's screen colors, they're easily changed with the special function keys. Press the fl key to cycle through the 16 border colors until you find one you like. The f3 key changes the background color and f5 changes the character color.

SpeedCalc -- a compact, powerful spreadsheet program written entirely in machine language.

SpeedCalc's input buffer always displays the contents of the data cell under the highlighted cursor.


Moving The Cursor

Each cell is identified with the letters of its column and the number of its row. For example, the cell at the extreme upper-left corner of the sheet is called AA1, since it's in column AA and row 1. The cell below that is AA2. Moving one cell to the right from AA2 puts you in cell AB2, and so on. (For the sake of clarity, this article uses uppercase letters for cell names. Note, however, that you must use lowercase letters such as aa1 when entering cell names within SpeedCalc.)

Your current position in the spreadsheet is shown by the highlighted cursor. The simplest way to move around the sheet is with the cursor keys, which work just as they do in BASIC. Another way to move the cursor is with the HOME key (press CLR/HOME without pressing SHIFT). Press HOME once to "home" the cursor on the current screen; the cursor moves to the upper-left cell. Press HOME twice in succession to move the cursor to cell AA1, the home position for the entire sheet.

SpeedCalc also has a goto command for moving over long distances. Press CTRL-G (hold down CTRL and press G). The command line turns blue and displays GOTO; followed by an underline cursor. The underline cursor generally indicates that SpeedCalc is waiting for data -- in this case it expects the name of the cell where you wish to go. If you enter bal88 at this point, SpeedCalc moves the cursor to cell BA188, adjusting the screen window as needed. Take a few moments to practice moving around the spreadsheet with all three methods -- you'll be using them a lot. In a later section, we'll discuss how to change the size and format of a cell.


Keyboard Commands

SpeedCalc offers many different commands, a few of which are entered by pressing one key. However, most commands are entered by pressing CTRL along with another key. CTRL-G, as you've seen, is the goto command. CTRL-A displays the amount of free memory available, and so on. The most drastic command is CTRL-X, which exits SpeedCalc and returns you to BASIC. Since leaving the program effectively erases all data in memory, SpeedCalc asks ARE YOU SURE Y/N? before shutting down. To cancel the command and return to the spreadsheet, type N and press RETURN.

A few commands require you to press three keys at once. This sounds more awkward than it is in practice, since two of the three keys are SHIFT and CTRL. For instance, the command to switch between automatic and manual recalculation is performed by pressing SHIFT-CTRL-R (hold-down SHIFT and CTRL, then press R). The accompanying table lists all the SpeedCalc commands, and the figure shows the keyboard layout with a description of what each key does. We'll be discussing each command in more detail below.


SpeedCalc Commands

Command: Action

CTRL-A: available memory check

CTRL-B: blank (erase) current cell

CTRL-C: copy block verbatim

CTRL-D: set number of decimals

CTRL-E: edit current cell

CTRL-F: change cell format

CTRL-G: goto selected cell

CTRL-M: move block verbatim

CTRL-P: print sheet

CTRL-R: turn on/off auto recalculation

CTRL-W: change column width

CTRL-X: exit SpeedCalc

CTRL-4: disk directory

CTRL-^: send disk command

CLR/HOME: home cursor

SHIFT-CTRL-C: copy block relative

SHIFT-CTRL-D: change decimal mode for all cells

SHIFT-CTRL-M: move block relative

SHIFT-CTRL-P: print to screen, disk, or printer

SHIFT-CTRL-R: display current recalculation mode

SHIFT-CTRL-W: change width of all columns

SHIFT-CLR/HOME: erase entire sheet

f1: change border color

f3: change background color

f5: change character color

f7: load SpeedCalc file

f8: save SpeedCalc file

<--: recalculate sheet


Three Data Types

Before entering any data, you must know what kind of data SpeedCalc accepts. There are three different types; numbers, text, and formulas. Let's look at each type in turn:

1. Numeric data consists of numbers -- the basic stuff that spreadsheets work with. SpeedCalc has a few simple rules for numeric data:

A number must be a decimal value (base 10, not hexadecimal) composed of one or more digits from 0-9, with an optional plus or minus sign. A decimal point is also optional. If you include any other characters in numeric input, SpeedCalc treats the entire input as text data (as explained below). Thus, the numbers 123, .001, and -65535 are valid numeric data. The numbers 65,535 (which includes a comma) and 312 Main Street are treated as text labels.

For example, let's enter the number 123 in cell AA1. No special commands are required to enter data; Just move the cursor to AA1 and begin typing. While you're entering the number, it appears only in the input buffer near the top of the screen. As soon as you press RETURN, the number appears in AA1 and the letter N appears at the upper-right of the screen. The N signifies numeric, meaning that SpeedCalc has accepted the entry as valid numeric data. Move the cursor to a vacant cell, then move it back to AA1. The input buffer displays whatever data is found in the cell under the cursor. When the current cell is empty, the buffer is empty as well.

As you can see, pressing RETURN enters a data item into the current cell. You can also end the input by pressing a cursor key. The data is entered as if you had pressed RETURN, and the cursor moves in the indicated direction. This feature is handy for entering a lot of data: Simply type the entry, move the cursor to the next cell, enter more data, and so on.


2. Text data is not "data" in the strict sense, since SpeedCalc doesn't use it in calculations as it does numbers and formulas. Text data is there only to help humans understand what the other data means. Text may consist of comments, titles, column headings, subheadings, or whatever you need to interpret the numbers and formulas. As an example, move the cursor to cell AA2 (just under AAI) and type the following line. Note that both uppercase and lowercase letters are acceptable:

This is some text data.

You can use the DEL key to erase mistakes while you're typing. When you press RETURN, SpeedCalc displays T (for text) in the upper-right corner. In this example, the cell isn't long enough to accept all the text, so only the leftmost portion appears in AA2. But even though you can't see all the text, it's there. Move the cursor to another cell, then move it back to AA2. As soon as you return to AA2, SpeedCak displays all the text in the input buffer.


3. Formula data is a mathematical expression or formula. It may be as simple as 2 + 2 or as complex as your imagination (and mathematical prowess) allows. The first character in a formula must always be an equal sign ( = ). If you omit this symbol, SpeedCalc either signals an error or treats the data as text. The true power of a spreadsheet is that a formula in one cell can refer to another cell. This is easier to demonstrate than to explain. Move the cursor to cell AA3 and type the following line:

=aa1*25.01+@sqr(4)

As soon as you press RETURN, SpeedCalc displays F (for formula) in the upper-right corner and puts the result of the formula (not the formula itself) in AA3. If AA1 contains 123, the value 3078.23 appears in AA3. In plain English, this formula means "multiply the contents of cell AA1 by 25.01 and add the square root of 4." Before we examine the formula more closely, here's a quick demonstration of what makes a spreadsheet such a powerful tool. Move the cursor back to AA1 and press CTRL-R. The command line displays the message RECALCULATION IS ON, meaning SpeedCalc now automatically recalculates the entire sheet whenever you make a change. Now change the number in AA1 to 456 (simply move to the cell and start typing). The new result (11406.53) automatically appears in cell AA3. We'll explain more about automatic recalculation later.

When you enter the name of another cell in a formula, the letters must be lowercase (enter aa1, not AA1). The referenced cell must contain data that SpeedCalc can evaluate: a number or another formula. If the formula refers to an empty cell, or one that contains text, SpeedCalc signals an error.


Mathematical Operators

These symbols can be used as operators in a formula:

Operator Function

+ addition

- subtraction

* multiplication

/ division

^ (up arrow) exponentiation

= equality

One factor that affects formulas is precedence, or the order in which mathematical operations are performed. In SpeedCalc, formula operators have the same precedence as BASIC -- the same as in general math.

The first operators to be evaluated -- those with the highest precedence -- are those enclosed in parentheses. Where one set of parentheses encloses another, the expression in the innermost set is evaluated first. The next operators to be evaluated are exponents. Multiplication and division have equal precedence; both operations are lower than exponentiation. Addition and subtraction have the lowest precedence of all. The mnemonic "My Dear Aunt Sally" (MDAS -- Multiplication, Division, Addition, Subtraction) is a reminder of mathematical precedence.

To take one example, SpeedCalc evaluates the formula =5*(8+3*-2)^2-10/+2 as the value 15, just as in ordinary math. Note how the result is affected by the plus and minus signs before the 2's.


Functions

Formulas may also include any of the functions listed here:

@abs( ) absolute value

@atn( ) arctangent

@ave( ) average of a block of cells [form: @ave(xxn:xxn))

@cos( ) cosine of argument in radians

@exp( ) complement of log, gives e^X (e = 2.7182318...)

@int( ) integer (rounds to next lowest whole number)

@log( ) natural logarithm base e (log of zero or a negative number is illegal)

@sgn( ) sign (-1 for negative numbers, 0 for 0, 1 for positive)

@sin( ) sine of argument in radians

@sqr( ) square root (root of a negative number is illegal)

@sum( ) sum of a block of cells [form: @sum(xxn:xxn)]

@tan( ) tangent of argument in radians. @tan(.5*pi) is illegal

pi value of pi (3.14159265)


All the functions except pi begin with the @ symbol and are followed by parentheses. Within the parentheses of a function you may use a number or formula. For example, the formula =@sqr(4) generates the square root of 4. The formula = @sqr(aa1) returns the square root of whatever value cell AA1 contains. Note that the argument (value within parentheses) of the functions @tan( ), @sin( ), and @cos( ) must be expressed in radians; the result of the function @arc( ) is expressed in radians.

The function @int( ) generates an integer (whole number) by rounding to the next lowest whole number. For positive numbers, this is equivalent to dropping the fraction, but for a negative number like -4.3, the next lowest number is actually -5.

The function @ave( ) calculates the mean average of the values in a block (group) of cells. The function @sum( ) calculates the sum of a block. Both functions require that you define the block so that SpeedCalc knows which cells to include in the calculation. This is done by putting two cell names separated by a colon in the parentheses. The first cell name defines the upper-left corner of the block, and the second defines the bottom-right corner. For instance, @ave(aa1:ad20) calculates the average of all the cells from AA1 to AD20. The function @sum(aa1:ad20) calculates the sum of AA1 through AD20, and so on. An error results if any cell in the block is blank or contains text data.


Math Notes

SpeedCalc uses the same ROM routines for math as BASIC. Therefore, it follows almost the same rules and has the same limitations. Numbers are accurate internally to only nine digits -- although you can enter long numbers and view them exactly as you entered them, only the first nine digits are used for calculations. If you enter a very long number (more than 36 digits), your input is ignored, and the cell reverts to its former state. You can also enter long numbers in the form 1.23E+05 (scientific notation). Note, however, that SpeedCalc itself never uses scientific notation. It converts all numbers to their full length, so long numbers actually use more memory than shorter ones.

Beware of math errors such as division by zero, square root of a negative number, tangent of pi/2, logarithm of zero or a negative number, and overflow conditions like 2^300. SpeedCalc detects these errors and displays *ERROR* in the cell of an illegal calculation.


Editing The Sheet

Editing is a very important spreadsheet function. The simplest way to change what a cell contains is to move to it and start typing. The old data in that cell is replaced by whatever you enter. For instance, to replace the contents of cell AA1 with the number 456, move to that cell, type 456, and press RETURN or exit with a cursor key.

Press CTRL-B (think of blank) to erase what's in the current cell. You can also clear a cell by typing a space and pressing RETURN, but this uses some memory. A truly blank cell doesn't use any memory.

To erase everything in the sheet, press SHIFT-CLR/HOME. Before carrying out this drastic operation, SpeedCalc asks you to confirm it by pressing Y or N.

In some cases, only a minor change is needed. Edit mode lets you change the data in a cell without retyping the entire entry. To activate edit mode, move to the desired cell and press CTRL-E. In this mode, the up/down cursor key is disabled, and the left/right cursor key moves within the input buffer. Erase unwanted characters with the DEL key. Typing in edit mode inserts new characters in the line: Everything to the right of the new character moves right one space (unless the buffer is already full). Since the cursor keys have a different function in edit mode, you cannot use them to end the input. Press RETURN to enter the new data and escape from edit mode.

As you may have learned already, SpeedCalc displays *ERROR* in a cell when you enter an erroneous formula. The usual cause is that you have made a typing error in that cell, or the formula refers to text or an empty cell. A line of asterisks (*********) signals that a number is too large to be printed in the cell. Though these messages appear in the cell area, no data is lost. You may move to the affected cell, view its contents in the input buffer, and make whatever correction is needed.


Recalculation

The recalculation feature is the very core of SpeedCalc. As you know, entering or editing a piece of data causes SpeedCalc to perform a calculation and put the result in the cell under the cursor. In most cases, the new data relates to data in other cells, so you’ll ultimately want to recalculate the entire spreadsheet as well. This can be done in two different ways: manually or automatically.

To recalculate the spreadsheet manually, press the back arrow key (<--, at upper-left on the keyboard). SpeedCalc begins at AA1 and recalculates every cell that contains data, placing fresh results wherever needed. SpeedCalc displays the message RECALCULATING while it's busy.

If you switch to automatic recalculation mode, SpeedCalc automatically recalculates the entire spreadsheet each time you enter new data or edit what exists. When you press CTRL-R, SpeedCalc changes the recalculation status and displays it at the top of the screen. If automatic recalculation was turned off before, it is now on (and vice versa). If you aren't sure which mode you're in, press SHIFT-CTRL-R; SpeedCalc displays the recalculation mode without changing it.

Automatic recalculation can be fun to watch in a large spreadsheet: Every time you make a change, new results ripple all the way down the screen. However, the more data your spreadsheet contains, the longer it takes to update the entire sheet. For this reason, you may want to turn automatic recalculation off most of the time, recalculating with the back arrow key whenever you need to view results.

One problem with recalculation arises from the order in which cells are calculated. Because only one cell can be calculated at a time, you must sometimes recalculate the entire spreadsheet two or three times to get correct results in every cell (this is common to all spreadsheet programs). For instance, say you have a formula in AA1 which refers to a formula in AB15. When SpeedCalc calculates AA1, it must use the existing data from AB15 --which is probably out of date, since the formula in AB15 hasn't been recalculated yet. To avoid this problem, you should always press the back arrow key two or three times before printing a spreadsheet or saving it to disk.

SpeedCalc offers a number of other features. Before experimenting with them, you should spend some time typing in a hypothetical spreadsheet -- perhaps a fictitious yearly budget -- to become thoroughly familiar with the basic commands covered so far. Most importantly, create formulas, using all the operators in different combinations. Try doing things that you know will cause errors. Then correct the errors in edit mode, and so on. It takes a thorough grasp of the fundamentals to get the most out of SpeedCalc's advanced features.


Change Type And Format

The default (normal) format for numeric data is flush right with rounding to two decimal places. In other words, the number is displayed in the rightmost part of the cell, with two numbers after the decimal point. Text and formulas are flushed left (shown in the leftmost part of the cell), SpeedCalc offers several commands for changing cell formats.

Change Format (CTRL-F). This command changes the location of data in the cell and the number of decimal places. When you press CTRL-F, SpeedCalc displays the question FORMAT: Left, Center, or Right justify? in the command line. Press L, C, or R to move the data to the left, center, or right of the cell.

Change number of decimal places (CTRL-D). This command lets you specify the number of digits displayed after the decimal point. The default value is 2, convenient for dollar amounts, but you may change it to anything from 0-15, If you choose zero decimal places, any number in that cell is rounded off to the nearest integer (whole number), A setting of 15 is special: The number in that cell is not rounded off at all. Instead, SpeedCalc displays the number exactly as you entered it or as it was calculated from a formula. Watch out for one feature of CTRL-D: It also resets the cell to right justification, so you may need to change this with CTRL-F.

Width (CTRL-W). The width command changes the width of an entire column of cells. Move the cursor to any cell in the desired column, then press CTRL-W. When SpeedCalc displays the prompt Width: you should respond with a number from 4-36. The entire screen is redrawn to accommodate the new format, and may look very different depending on what value you choose. For instance, if you increase a column's width, the rightmost column of the former display may disappear: SpeedCalc only displays as many complete columns as it can fit on the screen. If you decrease the width of a column, you may see asterisks where numbers used to be (indicating the cell is now too small to display the entire number). To get rid of the asterisks, expand the column as necessary.

Global Format (SHIFT-CTRL-F). This is the same as the ordinary format command, but operates globally, changing every cell in the sheet instead of just one. To alert you to the difference, SpeedCalc changes the color of the command line to blue.

Global Width (SHIFT-CTRL-W). This is a global version of the width command. The command line turns light green to signal the difference. Every column in the sheet changes to the designated width.

Global Decimal (SHIFT-CTRL-D). This command lets you change the number of decimals displayed for the entire sheet. The default for the sheet is two decimal places. Every cell changes to the designated setting, and the new setting becomes the default for future entries.


Macroediting

After typing in a large spreadsheet, you may decide to make a major change. You may want to add new data somewhere in the middle, delete a section, or move a group of cells from one location to another. SpeedCalc's macroediting (largescale editing) commands simplify such operations, affecting an entire block of cells at once. A block is simply a group of cells connected in rectangular fashion: You can define it as a single cell, a row or column, or any rectangular area within the spreadsheet.

There are two ways in which macro commands can work; verbatim or relative. To take a simple example, say that cell AA2 contains the formula =aa1*5 and you want to move its contents to cell AB2. When this is done in verbatim mode, AB2 contains an exact copy of what was in AA2 (=aa1*5). Note that the cell name used in the formula does not change: The formula still refers to AA1. If you perform the same operation in relative mode, the cell name in the formula is adjusted to fit the new location. In this case, AB2 would contain the formula =ab1*5.

Copy (CTRL-C). The copy command copies a block of cells into a different location without disturbing the original cells. Place the cursor on the upper-left corner of the block you want to copy, then press CTRL-C. SpeedCalc changes the command line to purple and prompts you to move the cursor to the lower-right corner of the block you want to copy. Once the cursor is in place, press RETURN. Now SpeedCalc prompts you to move the cursor to the place where you want to put the block: This is the upperleft corner of the new position. Once the cursor is there, press RETURN again. The new data replaces whatever was contained in the designated cells. Note that if you define an impossible block (for instance, moving the cursor to the upper-left of the original position, rather than below and to the right), SpeedCalc does not copy any data. You can use this trick to escape from Copy if you press CTRL-C accidentally. Another escape is to press RETURN twice while the cursor remains on the original cell.

Move (CTRL-M). This command works like a copy, but it fills the original cells with blanks. Though SpeedCalc has no insert command, you can use this command to make space for new data in the middle of a spreadsheet. Simply move everything below the insertion point down as far as you need. To cancel this command, press RETURN twice while the cursor is on the same cell.

Relative Copy (SHIFT-CTRL-C). This form of the copy command adjusts the cell names used in formulas within the copied block (see explanation above).

Relative Move (SHIFT-CTRL-M). This is the relative form of the move command. Cell names in formulas are adjusted to reflect the move.


Memory Management

SpeedCalc leaves 10,752 bytes of memory (10.5K) available for data. As noted earlier, SpeedCalc lets you spread your data out over a much larger number of cells than you can actually fill with data. The extra space is provided to give you full control over the final format of the spreadsheet -- for example, you could have a 15 X 150 spreadsheet -- and to leave some elbow room for move and copy operations.

Because memory is limited, you should keep careful track of how much is free while using the program. Press CTRL-A to display the amount of free memory. We suggest limiting your spreadsheets to 1,296 cells (equivalent to 36 rows by 36 columns). If you have filled nearly alt of free memory, you may have to break the spreadsheet into two smaller sheets.

Although SpeedCalc checks the amount of available memory, and displays an error message if you run out of memory, you should be careful not to exhaust free memory. Any move or copy operation in process will be aborted if sufficient memory is not available.


Disk Operations

SpeedCalc has four disk commands which allow you to save a spreadsheet to disk, load it, display the disk directory, and send commands to the disk drive. The directory command is the simplest to use. Press CTRL-4 (think of the dollar sign, as in LOAD "$",8 to list the directory from BASIC); The screen clears and the directory is displayed. Press RETURN to return to the normal screen. You may pause the directory display with the space bar.

To save a spreadsheet to disk, press the f8 function key (SHIFT-f7). SpeedCalc prints SAVE: on the command line, followed by an underline cursor, Enter a valid Commodore filename and press RETURN. (If you change your mind and decide not to save anything, press RETURN without typing a filename.) The disk drive spins for a few moments, then SpeedCalc prints the drive status in the command line. The message 00,OK,00,00 means there were no errors.

To load a saved file from disk, press the f7 key. Again, SpeedCalc prompts you to enter the filename and displays the disk status when the operation is complete. SpeedCalc files are saved as PRG (program) file types, but do not load as normal program files. SpeedCalc uses special header bytes to identify a SpeedCalc file. If you try to load anything other than a valid SpeedCalc file, you'll see the message NOT A SPEEDCALC FILE.

You can send Commodore disk commands to the drive with CTRL-^ -- press CTRL and the ^ (uparrow) key together. SpeedCalc prompts you to enter a disk command. The CTRL-^ command works much like the Commodore Wedge utility. If you press RETURN without typing a command, SpeedCalc displays the drive status and sends no command. You need not enclose the command in quotation marks or type ,8 after it. For example, press CTRL-^, then enter I0 to initialize a disk. Consult your disk drive manual for more information about Commodore disk commands.


Printing

SpeedCalc lets you print data to three different devices: to the screen for previewing output, to a printer for permanent documentation, or to a disk file for integrating the data with another program.

To preview your spreadsheet on the screen, press SHIFT-CTRL-P, then press S (screen output) when prompted. Naturally, the display will look odd if your sheet is wider than 40 columns. Think of each pair of 40-column lines as one 80-column printed line.

To print a hardcopy of the spreadsheet, press CTRL-P. If your printer is configured like most, this should produce a satisfactory printout. This command sends output to the printer as device number four with a secondary address of seven (uppercase/lowercase on most systems). Before using this command, you must position the cursor below and to the right of the block of cells you wish to print. The upper-left corner of the printout starts at cell AA1. The entire width you define by this position is used. Therefore, don't try to print overly wide spreadsheets that won't fit on the paper. If you want to print a spreadsheet wider than 80 columns, many printers have a condensed mode that lets you fit 132 characters on a line. You can set this by switching an internal DIP switch, or by sending a CHR$ code from BASIC before running SpeedCalc. Many printers respond to this command for condensed mode: OPEN 4,4:PRINT#4,CHR$(15):CLOSE 4.

To send output to a printer with a device number other than four or a secondary address other than seven, enter SHIFT-CTRL-P, then enter the device number and secondary address when prompted. During a printout, you can pause the output by pressing SHIFT or SHIFT LOCK. The screen border turns white and printing ceases until you release SHIFT. Press RUN/STOP to abort printing.

You can also print SpeedCalc data to a disk file for use with terminal programs, databases, or word processors (including SpeedScript). Select the D option after pressing CTRL-SHIFT-P, then enter the filename you wish the new file to have. The data is saved as a SEQuential disk file of that name. The disk file is an exact Commodore ASCII image of what would go to the printer.

Note that printing to disk creates a different file than saving to disk: You should save files that you wish to reload into SpeedCalc, and print files that you wish to convert for SpeedScript or other programs. While you may pause this operation with SHIFT as with printer output, do not use RUN/STOP to abort printing to disk. This may create a "poison" (unclosed) file which can be safely removed only by validating the disk.


SpeedScript integrator

SpeedCalc sends data to the printer in simple, plain-vanilla form. That may be fine for personal use, but if you're creating a document for others to view, you may want special features such as boldface, underlining, etc. Since SpeedScript -- COMPUTE!'s popular word processor --already offers a way to access these features (and many more), no attempt has been made to include them in SpeedCalc. All that's needed is a simple program to convert SpeedCalc files into a form that SpeedScript can load. Then you can edit the file with SpeedScript as you would any other document -- inserting printer control codes, reformatting the text, merging it with other text, and so on.

Type in and save Program 2, using MLX as you did with SpeedCalc. Enter 0801 as the MLX starting address and 0948 as the ending address. Like SpeedCalc, the SpeedScript Integrator loads and runs exactly like a BASIC program, even though it's written in machine language. Here are the steps to convert a SpeedCalc file for SpeedScript:

1. After creating a spreadsheet with SpeedCalc, print it to disk as described above.

2. Exit SpeedCalc, then load and run the Integrator. The program prompts you to enter the name of the SpeedCalc file you printed to disk. Then it asks you to enter the name of the SpeedScript file you want to create (of course, this name should be different from the first). The Integrator then constructs a SpeedScript-loadable disk file from the SpeedCalc file.

3. After the Integrator is finished, load and run SpeedScript, then load the new SpeedScript file as you would any SpeedScript document. The data appears on the screen, ready to be edited in any way you wish.

If you already have the SpeedScript File Converter published with the March 1985 SpeedScript 3.0 article, you can use its Commodore ASCII to SpeedScript option to convert SpeedCalc files. This option works like the Integrator.


ref: Kevin Martin, "SpeedCalc: For Commodore 64 And 128", COMPUTE!, January 1986, pp.66-84

note: The SpeedCalc 2019, enhanced version of SpeedCalc, modded by İlker Fıçıcılar, can be downloaded in the Programs section of http://cbm.ficicilar.name.tr/ website.

Kevin Martin
01.01.1986

Keywords: Software, Commodore, C64, C128, Spreadsheet, SpeedCalc


C64 Projects Twitter Page

İlker Fıçıcılar's CBM Page