Beta Basic 3.0

Author(s): Robert Hartung
Pub Details: Time Designs Magazine v3 n4 (Volume 3, Issue 4)
Date: May/June 1987
Pages: 19-20

When I first loaded Beta Basic and began working my way through its well-written 90-page manual, my impression was, “Wow! This is almost like having a poor man’s QL!” Of course this extension to Sinclair Basic must work within the hardware limitations of a T/S environment, but after a year of learning my way around it a bit I am even more convinced that it provides our “toy” computers with what is probably the most powerful Basic programming language available on any 8-bit micro today.

Many of its over 100 new and enhanced commands and functions have several variations. Except for TS2068 commands that are not available in Spectrum mode (STICK, SOUND, ON ERR, RESET, FREE) it is completely compatible with Basic programs that have been entered and saved on either a TS2068 or Spectrum. (Free bytes function MEM(), and ON ERROR line no. and ON ERROR statement: … are supported.) This means that any T/S Basic program that will fit under a 46679 RAMTOP may be loaded in with BB in-residence and and its toolkit features used to edit, split, join, re-number, or make block-moves or copies in the listing with all discrete line-references changed accordingly. Keying in a zero before any line number immediately brings that line into the editing area without shifting the listing display. AUTO line numbering in any step may be turned on or off.

After all this, if no BB-specific command words have been inserted into the listing, it may be saved again as a TS2068 or Spectrum program, or selected blocks of the listing or data in memory may be saved from the complete program. If saved with the special line 0 containing BB directives, it may contain any of the BB commands and will run with the BB code in-residence. As supplied, BB is cassette and MicroDrive compatible, with adaptations available that will work with WafaDrive as well as Opus, Kempston, Oliger, and other Spectrum-compatible DOSs. It takes about 125 seconds to load from tape.

Personally, I would think this program worth having for its editing features alone, but that is barely the beginning of all that it does. Probably the one most powerful feature is that procedures can be created, each of which may then be called by a single word. In effect, this allows the user to create a library of new command words, limited only by your ingenuity and available memory. Procedure parameters and internal variables designated as LOCAL do not affect other program variables which have the same names. DEFAULT values for parameters and other variables may be pre-defined. DATA may be used as a procedure parameter.

By using stored addresses, FOR-NEXT loops run at constant speed anywhere in the listing, unlike T/S Basic, and are about 2 times faster at the first line, 5 times faster at the 100th, and 17 times faster at the 500th line. GO TO and GO SUB are also faster and RETURN is just as fast from the last line as from the first. The DO-LOOP structure is supported as well as WHILE, UNTIL, EXIT IF, ON, and ELSE. SORT will re-arrange any array of strings, numbers or letters, in ascending or descending order–400 of them in about 3 seconds. INARRAY and INSTRING will search for any given target string. ITEM() checks for the last item of DATA and whether any item is numeric or a string. READ LINE allows READ to work with DATA that otherwise would need quotes.

Graphic and display control are provided in any of 127 user-defined windows, with wraparound pixel-by-pixel and attribute ROLL in any direction as well as SCROLL in any direction. FILL will surround all closed figures with designated PAPER color or fill any closed figure at given coordinates with designated INK color. CSIZE provides characters in any size from 80 columns per line to one filling the entire screen, as well as reducing or enlarging any text or any portion of the display put into a string by GET, which you may then PLOT anywhere you want it on the screen. Plotting scale and 0,0 origin coordinates may be set with four special variables.

Other commands and functions include OVER 2 which allows superimposing printed or plotted text or graphics without affecting what is already there. STRING$ will print any character or string a given number of times. Cursor control codes may be imbedded in text to change print positions in the display. USING or USING$ may be used to align printed columns of integer and decimal values and truncate to the desired number of places. LLIST expands token-words and TAB is translated to the proper number of spaces before being sent to a full-size printer. (The ProFile printer driver routine will work in BB/Spectrum mode by using POKE 63688,84 and POKE 63689,31 before moving it just below the BB code.) SCRN$ recognizes UDGs along with the normal characters recognized by SCREEN$. A real-time CLOCK provides options of display and/or audible alarm and/or timed GO SUB.

KEYWORDS n provides one-key entry of Keywords, letter-by-letter entry, or combination of both. The KEYIN command actually can be used to create self-writing programs. All variables and their contents may be listed, or all lines that contain a given reference or procedure may be displayed in succession for examination or editing. The ALTER __ TO __ command may be used (but with caution!) to change every occurance of a given word or character-sequence wherever it appears in memory. A TRACE function may be used to single-step through a program for de-bugging. Strings, arrays, or blocks of data may be displayed for editing and may be moved, joined, or copied in memory. Any part of memory may be put into a string. LET a=x,b=y,c$=”z” is supported.

Any or all character keys may be user-defined to produce a complete program line or a conversion formula or an entire subroutine with one key-stroke, and these definitions may be saved with the program. Hex and decimal conversion functions are provided, as is decimal to binary and bit-by-bit AND, OR, and XOR of two numbers. CLEAR n<768 moves RAMTOP without loss of variables. BREAK will stop machine code endless loops. Listing formats indent wraparound lines to the fifth column for easier reading. Options provide listing of multi-statements on separate lines, with some commands indented further.

A random number function is 2 1/2 times faster than RND*n. SINE and COSE functions give four-place accuracy 6 times faster than SIN and COS. DPEEK yields decimal result of a double PEEK and DPOKE does LSB, MSB double POKE of a decimal number to a given address. CHAR$ converts 0-65535 integer values to two-character strings and NUMBER converts them back, at a saving of 60% in use of memory. MOD gives remainder of one number modulo another.

Since no review can provide the “picture that is better than a thousand words,” with the permission of BetaSoft I have written a 20K-byte demo which shows typical listings and runs actual examples of about 85 of the new and enhanced commands of this remarkable software for the Spectrum/Emulated TS2068. It is available for $5.00 to cover the cost of postage, packaging, tape, and handling by writing to me at 2416 N. County Line Rd., Huntertown, IN 46748. Please note that, to protect BetaSoft’s copyrights, the version of Beta Basic included to drive this demo will NOT allow editing or use with any other listing but the demo may be used as a tutorial when loaded with normal BB. Beta Basic 3.0 may be purchased for 15.50 in British pounds (about $25.00) from BetaSoft, 92 Oxford Rd., Moseley, Birmingham B13 9SQ, England. Payment may be by international money order, or MasterCard for easier currency exchange.