--- title: "Omni Template Rev. 1" id: 71993 type: "computer_media" slug: "omni-template-rev-1" url: "http://localhost/computer_media/omni-template-rev-1/" markdown_url: "http://localhost/computer_media/omni-template-rev-1.md" published_at: "2026-10-20T14:07:45+00:00" modified_at: "2026-10-20T14:14:06+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/10/FITPOINTS.png" excerpt: "A structured-programming template with named utility subroutines for titles, keypresses, number formatting, sorting and menus, plus three example programs built from it." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "Omni Technology" slug: "omni-technology" taxonomy: "post_tag" url: "http://localhost/tag/omni-technology/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" model: - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" indiv: - name: "Mimi Cho" slug: "mimi-cho" taxonomy: "indiv" url: "http://localhost/indiv/mimi-cho/" genre: - name: "Programming" slug: "programming" taxonomy: "genre" url: "http://localhost/type/programming/" media_type: "Cassette" programmers: - name: "Mimi Cho" slug: "mimi-cho" taxonomy: "indiv" url: "http://localhost/indiv/mimi-cho/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Omni%20Template%20Rev%201%20%28198x%29%28Cho%2C%20Mimi%29%28TS1000%29%28US%29%28Cassette%29.zip" mediadate: "198x" producer_company: - id: 11147 title: "Omni Technology" type: "company" url: "http://localhost/company/omni-technology/" images: - url: "http://localhost/wp-content/uploads/2026/10/FITPOINTS.png" - url: "http://localhost/wp-content/uploads/2026/10/RACING0.png" - url: "http://localhost/wp-content/uploads/2026/10/CALCULATOR.png" - url: "http://localhost/wp-content/uploads/2026/10/OmniTemplate-scaled.png" - url: "http://localhost/wp-content/uploads/2026/10/Omni-Template-scaled.jpg" related_products: - id: 13470 title: "Omni Template" type: "product" url: "http://localhost/product/omni-template/" media_type_tags: "Programming" --- # Omni Template Rev. 1 Provides a skeleton for writing structured BASIC programs: a header block for the program name and description, a definition block for arrays and documented variables, a program block, a user-routine block and a library of utility subroutines. Each routine’s line number is stored in a named variable such as `TITLE`, `GETKEY` or `SORT`, so code calls them with `GOSUB TITLE` rather than a bare number. The utilities center a title, wait for a single keypress, format a number to a set of decimal places, sort a value array along with an index array, and show a numbered menu. Three example programs built from the template are on the tape: a formula calculator, a least-squares curve fitter and a lap-time ranking program. The printed cassette label reads “OMNI TEMPLATE REV. 1” with a handwritten “<135>”, and each program opens with the REM header “OMNI TEMPLATE REV.1 BY MIMI CHO”. A period advertisement from Omni Technology of Pittsburgh, Pennsylvania offered the tape for the ZX80 and ZX81 at $9.50 before September 1, 1982, with a listing and manual, and named RACING, INDEX-CARDS and FIT-POINTS as the example programs. This tape has a CALCULATOR example in place of INDEX-CARDS. The tape files are: - `TEMPLATE`: the blank template, with empty REM lines left in every block for the user to fill. - `CALCULATOR` (saved as `CACULATOR`): reads a formula as a string and evaluates it with `VAL`, printing the result. - `FITPOINTS`: takes up to 50 X,Y pairs and fits a straight line, a semi-log (`Y=A*EXP(B*X)`) or a log-log (`Y=A*X**B`) curve by least squares, reporting A, B, the correlation coefficient and standard error, then interpolates Y for entered X values. - `RACING`: takes IDs and three lap times for up to 20 participants and ranks them by any lap or by total time in a formatted table. ## Program Analysis ### Program Structure Line numbers are fixed by block: 5–45 header, 1000–1300 definitions (arrays at 1015, string variables A$–Z$ at 1050–1175, numerics after 1185), 1500–1700 routine-address assignments, 2000 main program, 3995 `STOP` as `END`, 4000 user routines, and 7000 onward the utilities (`TITLE` 7100, `GETKEY` 7200, `NUMFORMAT` 7300, `SORT` 7500, `MENU` 7700). The example programs fill in the REM placeholders, add their own named routines (for instance `GETDATA`, `CALC`, `OUTRESULT`, `INTERPOLATION`, `STRAIGHT`, `SEMILOG`, `LOGLOG` in FITPOINTS) and customize the menu text. ### Notable Techniques - Computed `GOSUB`/`GOTO` through long variable names (`GOSUB GETDATA`, `GOTO END`) makes the main program read like a list of procedure calls. - The `GETKEY` routine first waits for all keys to be released, then for a new key, avoiding auto-repeat from a held key. - `TITLE` centers a string with `PRINT AT 0,16-0.5*LEN T$`. - The sort carries an index array `I()` alongside the values `R()`, so RACING can rank records without moving the name and lap arrays. - FITPOINTS fits the curved models by taking `LN` of the data and reusing the linear least-squares routine, then converting A back with `EXP`. - Long data-entry loops clear the screen every few entries (`(I/9)-INT (I/9)`) to avoid the scroll prompt. - `FAST` around calculations and sorting, `SLOW` for display. ### Potential Issues - In the blank template the bubble sort compares `R(I)` with `(I+1)` rather than `R(I+1)`; RACING has the corrected line. - CALCULATOR’s sort routine is a different, Shell-style version that never ends its inner loop (`J` is incremented without a bound check). CALCULATOR does not call it. - `NUMFORMAT` reports a decimal point error when `DECIM` is 0 even though the next lines handle that case, computes the fraction as `INTNUM-INNUM` (negative), and its padding lines `LET V$=""+V$` add nothing. - In FITPOINTS the log-log result is labeled `Y=EXP (A)*X**B`, but A has already been converted with `EXP` before display. - RACING returns to the menu with `GOTO 2011`, a line that does not exist; the ZX81 continues at the next line, 2015, which is the intended effect. ## Source Code ``` 5 REM OMNI TEMPLATE REV.1 10 REM BY 15 REM MIMI CHO 20 REM ======================== 25 REM PROGRAM NAME: 30 REM PROGRAM DESCRIPTION: 35 REM 40 REM 45 REM 1000 REM ======================= 1005 REM DEFINITION BLOCK 1010 REM ----------------------- 1015 REM ARRAY 1020 REM 1025 REM 1030 REM 1035 REM 1040 REM ----------------------- 1045 REM STRING VARIABLES 1050 REM