Commodore User


Basic Subroutines For Commodore Computers
By John Wiley
Commodore 16/64/Vic 20

 
Published in Commodore User #7

Basic Subroutines For Commodore Computers

Books which teach people how to program now fill the shelves at most bookshops. But most of these only deal with the theory of programming, providing little in the way of practical guidance.

As a beginner, what you need, once you've mastered the rules of Basic and can string a few lines together is something to teach you how to use your knowledge to write useful and usable programs.

Unfortunately, in those books which do offer sample programs, these programs are often riddled with bugs or misprints. Someone who is just learning to program is not going to be able to find any errors and put them right, and so is faced with the prospect of spending a lot time keying a program in just to find that it does not work.

Basic Subroutines For Commodore Computers contains a large number of really useful programs. They range from simple conversions (gallons to litres, pounds to tonnes and so on) to business, loans and investments, matrix operations, statistics and sorting; they come as 22 chapters arranged in alphabetical order of subject.

Each 'problem' has its own subroutines written to solve it, which allows you easily to incorporate it into your own programs; and there's also a 'menu' which connects all the subroutines on a given topic to form a general program for matrix operations or temperature conversion.

This has an extra advantage that a program can be keyed in and tested one part at a time. That is the essence of 'structured programming'; and it means you can get a working program without having to key in hundreds of lines of code, adding to it section by section as time permits.

The programs so not use any advanced statements, PEEKs or POKEs. That manes they're easy to understand but will also run on any Commodore machine without trouble. The only problem will be for people who own Vic-20s as the programs are set to give 40 column displays.

Conclusion? The book is just the thing for a beginner in programming. It will show you how to write problem-solving programs which providing the nucleus of a library of useful programs and subroutines. The printing method means that all the programs should work first time, assuming that they have been keyed in correctly.

Too many conversions but still recommended... even at that price.

Chris Preston