Omnicalc 2

Products: Omnicalc 2
Date: 198x
Type: Program
Platform(s): TS 2068

Omnicalc 2 is a spreadsheet designed to make full use of the TS2068, with up to 99 columns or 250 rows. When it starts you choose to load a sheet or initialise a new one and give the number of columns and rows. Each cell holds an equation, a value, text or nothing, and rows and columns can be inserted or deleted, totalled and sub-totalled, filled with repeated entries, extracted and inserted between sheets, and given headings (month names are built in).

The whole program is a single BASIC program, omnicalc2, that starts itself. Almost all of it is machine code held in a REM statement in line 1.

Program Analysis

Structure

  • Line 1 starts the machine code with RANDOMIZE USR (PEEK 23635+256*PEEK 23636+40). It reads the start of the BASIC program from system variable PROG and adds the offset of the code inside the REM, so the code runs wherever the program is loaded. The rest of line 1 is the code itself.
  • Lines 3–5 hold the commands for saving and reloading the program.

Notable Techniques

  • The sheet is kept in BASIC arrays, which the code creates with DIM V(L,C), DIM V$(L,C) and DIM H$(C+C+L,7): a numeric array and a string array the size of the sheet, and a seven-character string array sized from the numbers of rows and columns.
  • Some calculations are stored inside the code as BASIC text, such as LET c=c+((l-c) AND l>c) and LET l=INT (l/c), which suggests they are run through the BASIC interpreter.
  • All prompts and error messages (for example “Equation/Value/Blank/Text?”, “Total/Sub-tot?”, “too big-reinput”, “calc.error”) are short one-line messages, which leaves the most room for the sheet.

Related Products

Spreadsheet designed to make full use of the TS2068. Up to 99 columns or 250 rows. All math functions supported.

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.