Using external utilities

This BASIC provides a very minimal program writing system, with a very limited EDIT and no AUTO at all, in favour of doing things the original Dartmouth (and Unix) way by editing BASIC programs with the plethora of external programming utilities that the operating system itself has. The filename argument form of basic(1) and basica(1) is for loading and running a program from file, the --command form is for running prepared lines of code, and the interactive ‘open mode’ for simple read‐execute‐print work. This is much like shell script programming, Tcl programming, and other languages.

Editing

To screen edit a program use any number of Unix text editors from ex(1); through ee(1), mg(1), nvi(1), vim(1), and an array of other vi clones; to The Hessling Editor. These, and several dedicated development environments, can provide a richer toolset than any dialect of BASIC ever came with built‐in with the likes of EDIT and AUTO. The vi clones, for example, are capable of syntax highlighting (although they do not know all of the keywords from all BASIC dialects, including this one). They and ex(1) can perform complex programmatic editing operations like selective regular expression find and replace, or indentation and capitalization changes, or moving entire blocks of code around with multiple paste buffers.

Numbering

To create an automatically numbered program, not that this is needed, screen edit it without numbers and use linenumber(1) (possibly with --start 10 --step 10) to number it.

Merging

If all that is needed from a merger is simply appending one program to another, then the cat command suffices. Problems arise when multiple lines have the same number, and one solution is simply to remove as many line numbers as possible, leaving in just those addressed by GOTO or GOSUB. Any remaining conflicts can be resolved manually using numbers that have just been deassigned, before concatenation.