Link to editorial & letters
Link to files
Previous disk program notes
Next disk program notes
Disk 5 program notes
*****************
* PROGRAM NOTES *
*****************
"CATALOG" SUITE by DAVE MARRIOT
1. PURPOSE.
-----------
This suite allows the creation and maintenance of a Database
of details of all Programs held on your discs (this, in fact,
includes all disc files - Code files, Snapshots, etc. - but
for simplicity they are referred to as "Programs").
2. REQUIREMENTS.
----------------
The suite requires a Sam Coupe with 256k or 512k of RAM, one
or two disc drives, and optionally, a printer. It MUST run on
ROM 3/DOS 20 or later.
3. CAPACITY.
------------
Information on up to 160 discs and up to 9999 programs can be
held. Information maintained is as follows:
DISCS:
IDENTITY - Up to 3 characters
DESCRIPTION - Up to 28 characters
PROGRAMS:
NAME - 10 characters
DOS TYPE - 1 character (indicates Basic, Code, etc.)
USER TYPE - 1 character (used for Sorting & Enquiries)
DESCRIPTION - up to 32 characters
DISC ARRAY - reference to which disc(s) the program
appears on
4. PROGRAMS IN SUITE.
---------------------
There are four programs in the suite, as follows:
4.1 CATSETUP.
This program does the initial set-up of the Database, and
should only be needed once.
You enter details of all your discs - Identity and
Description, as above - and then load each one in turn.
A Database entry is created for each program on each
disc, and when all discs have been processed, any
duplicate program entries are merged. Then you are
prompted to enter User information - User Type and
Description, as above - for each program entry (as this
might be a lengthy operation, you have the option to skip
it, and add the User information bit by bit, via program
CATCOMMENT or CATALOG instead).
TIP - it is best to decide on standards for Usertypes
before beginning to enter User Information - something
like G for Games, U for Utilities, S for System files,
etc., might be appropriate. Remember that Usertypes are
accepted in upper or lower case, and that Sorts and
Enquiries on them are case-sensitive.
4.2 CATCOMMENT.
Like CATSETUP, this program should only be needed when
the Database is initially set up.
It allows the entry of User Information - Usertype and
Description - for a few programs at a time, and can be
used instead of the final phase of CATSETUP if there are
too many programs to annotate all at once. When loaded,
it starts at the first program with blank Usertype and
Description, and allows you to enter information from
that point to the end or until you get fed up, at which
point the Database is saved to disc again; subsequent
runs of the program will pick up where you left off.
4.3 CATALOG.
This is the main Database Maintenance program.
On entry, you are prompted for the current date and time,
and then presented with the Main Menu, which includes the
following options:
ENQUIRE ON PROGRAMS
This allows listing of all programs which meet certain
criteria; enquiries can be on Dostype, Usertype, Name
(full name, "starts with" or "includes"), by Disc, or
all programs regardless. The programs can be shown with
Descriptions and/or the Discs they appear on, if
required, and output can be to screen, printer or both.
CREATE / UPDATE / DELETE PROGRAM
These work on individual program entries.
CREATE / UPDATE / DELETE DISC
These work on individual Disc entries. "UPDATE" allows
the Disc Identity to be changed without affecting the
cross-reference of programs on it; "DELETE"
automatically updates the entries of any programs that
appeared on that disc.
Also, all disc entries can be listed or printed.
SORT DATABASE
This sorts the Disc entries on Identity, and/or the
program entries on Name, or Name within Usertype. A
Basic Selection sort is used, and a full sort of
programs is likely to take some time, although it can
be abandoned without corruption partway through by
holding "CNTRL" and "Q" - only the highest entries will
be sorted. The disc sort cannot be abandoned, but will
not take so long.
PRINT DATABASE
This outputs the whole database to the printer.
INFORMATION
This gives a sub-menu of information on the use of the
program.
4.4 CATBATCH
This program performs automatic updates on the Database
from the contents of a whole disc, and is intended for
use when a large number of programs have been written,
erased, moved about, etc., since the Database was last
updated.
The program prompts for the Disc Identity, and then
checks the disc and updates the Database in the light of
any changes to it. All relevant changes are detected -
existing and new programs which have appeared on the disc
since the Database was updated, programs which have gone
from the disc, and programs whose Dostypes have changed.
For completely new programs, new entries are created and
you are requested to enter the Usertype and Description
for these.
As many discs as required may be processed in this way,
until you tell the program to finish (Note that the discs
themselves must already exist in the Database - entries
for any new Discs must first be created using CATALOG);
at this point, entries for programs which are not
recorded as being on any discs will automatically be
deleted before the Database is saved. Hence, if programs
have been moved from one disc to another, both these
discs should be processed in one run of CATBATCH.
CATBATCH allows the choice of either disc drive if you
have two fitted.
5. TECHNICAL INFORMATION.
-------------------------
All programs in the suite are written in Basic, with no
machine code, and make extensive use of Procedures. If
LISTed, a CLS# should be done to prevent the colour codes in
the program obscuring the listing.
One MODE 4 screen is used, with Palette changes to positions
8, 9, 10, 11 and 12 in CATALOG. CATALOG and CATBATCH set
CNTRL+Q (KEY 279) to return CHR$ 1.
Use of RAM outside the Basic Program area is as follows:
(i) The Database block itself is held between RAMTOP and
the "OPEN TO" address, at 65536 or 81920 depending on
the program.
(ii) All programs except CATCOMMENT use 512 bytes of the
System Heap (usually at 16384) for reading Disc
Directories.
(iii) CATALOG loads a code file "rcfix" into the Line
Interrupt Colour Buffer at 22144 for 344 bytes; this
modifies the effect of RUN and CLEAR to avoid an
obscure ROM bug with programs of this size (Note that
if this code is ever used with programs that change
colours within the screen using the "PALETTE...LINE..."
command, no more than 60 such changes should be used).
6. DATABASE STANDARDS.
----------------------
Disc-Id's and Program Names and Dostypes are all maintained
in upper case; user inputs for these are automatically
converted to upper case as necesssary. Disc Descriptions and
Program Usertypes and Descriptions can be in either case.
Duplicate Program Names are not catered for; any such entries
are assumed to be different occurrences of the same program,
and are automatically merged.
Program entries are not allowed to exist unless they are
recorded as being on at least one disc, apart from
temporarily during a CATBATCH run, as mentioned above.
The four programs in the suite, and the Database code block
itself, are all expected to be on the Default drive (as set
by the "DEVICE" command).
_______________________________________
OPUS TO SPECMAKER by Stephan Haller (via Ian Spencer)
I thought you might be interested in a couple of programs for
the supplement. The first was written by "Stephan Haller"
( who was only 13 when he wrote the program ), it allows the
SAM to read OPUS basic and code files and convert them to
"Specmaker % files" and save them to Sam diskette. This is a
boon for OPUS users who want to transfer programs to
"Specmaker". The only restriction is the OPUS disk must be
formatted with 256 byte sectors, but I think this is fairly
standard for OPUS disks.
After loading the program insert the OPUS disk and answer the
cat question, you can then load a file from opus diskette.
After loading you reinsert the "Specmaker" diskette and the
program saves the file as a "% file". You can then reinsert
the OPUS disk and load another file.
_____________________________________________
EDs NOTE:-
Please note that this program uses the standard
256k sector discs that the Opus defaults to. It does not need to
be configured to 512k sectors that previous Opus/Sam disc have.
_______________________________________________
DISC REORGANISER by Ian Spencer
This is a program I wrote because I often have a problem with
files being in a chaotic order on my Sam diskettes. It's called
"REORG" and allows you to choose which file you want first in
the directory of your diskette which second and so on. Any files
not selected are simply copied to the end of the directory so
nothing is lost. The program is fairly simple and written in
Basic, however one interesting point is that I didn't write
the program on the Sam I wrote it on an IBM compatible PC using
WORD 5 and then read the PC diskette into SAM as a basic
program. When I have time I will clean up the PC reading
program and send you a copy, at the moment it's very primitive.
Or perhaps another user will write a definitive PC reading
program.
_______________________________________________
ADDRESS MANAGER by Andrew Rigley
A very useful program which will store all your names,
addresses, phone N0s ans notes on a very simple to use datafile.
Facilities for LOADing and SAVing data are provided, as well as
search and browse options.
The program is self explanatory, and runs from a main menu of
options.
_______________________________________________
TRON by Andrew Rigley
This is the old favourite "LIGHT CYCLES", redone using the extra
commands of the Sam. It is a 2 player game, and all instructions
and controls are contained within the program. This one will
really have you pulling your hair out.
_______________________________________________
AMIGA GALLERY compiled by D.Tonks
Fed up with all those ST rip off screens? Well this issue I've
given you some Amiga screens for you to look at. After much head
scratching, I've managed to get the Sam to LOAD an Amiga screen
file.
If anyone wants to know how I did it, please contact me, and I
will explain the procedure.
_______________________________________________
COLOUR CLIP ART
Another screen$ full of odds and ends of graphics for you to
GRAB and use in your own programs/demos.
If anyone has done any programs/demos using these COLOURCLIP
screen$, then I would be only to happy to publish them.
________________________________________________
SMALL CHARACTER SET
A character set block of code which loads in memory at address
20880 and, when used with CSIZE 6,6 MODE 3, produces one of the
smallest character sets you have ever seen.
A viewing option is given in the program, as well as the option
to save to code to your own disc.
_______________________________________________
BILLS by Steve Monk
Following on from last issues "VIDEO DATABASE", Steve has sent
us his BILLS program. This program can be used with gas,
electricity or telephone bills, and allows you to input meter
readings and get estimates for your bills up to date. A printer
is catered for and a hard copy can be printed out (if you really
want to frighten yourself) of costs etc.
....
FLASHMOD 2 by Robin Clarke
Another new BASIC for you to tack onto FLASH. This one gives all
the previous mods plus a much improved colour chart, which gives
a clear indication of Sam colours and their relevant number.
Also in the mod is a QUIT option which allows rapid exit to the
Sam start up screen.
The program puts itself onto your FLASH disc, and the new
options are in the extra menu in the FILE icon.
_______________________________________________
HI-LO by Darren Talbot
This will hold no suprises for computer users of a few years
standing. It's that card game where you have to decide whether
the next card is higher or lower than the previous card.
Having said that however, it is still a very playable little
game and uses the card routine from issue 4 to good effect.
_______________________________________________
FRACTALS by John Saunders
A couple of fractal programs and a demo screen, which try to
simply explain the principles of fractal generation.
You would be advised to read John's letter in this issue before
loading, as it give the background to the programs.
_______________________________________________
LABEL PRINTER
This utility was originally written for a STAR printer, but as
it is all in BASIC, could easily be modified for other makes.
When used with the LC10 or LC200 colour printers, it gives the
option of printing out labels in colour.
The program contains notes on use and modification for
non-colour printers.
_______________________________________________
DIY MENU by Bob Evans (program in issue 4)
What you have here is a disc menu system that is very easy to
set up and use, and which gives you a scrolling list of programs
on your disc after simply pressing F9.
The program is in 2 parts, the first of which is a small BASIC
program and the second a screen$. Both of these have to be put
on your disc.
After LOADing the demo on this disc, break out of it with ESC,
and insert the disc that you want the menu on.
Now type in:- SAVE "AUTO" LINE 1: SAVE "MENU$" CODE 65536,24627
and press RETURN.
You now have both parts on your disc, but before it will work
correctly, you will have to do a couple of small mods to the
BASIC.
Clear your machine, insert your disc and press F9. You should
see the menu after a few seconds. Now break it with ESC, and
LIST the program. Line 30 contains a variable CO, this should
be edited to read LET CO=n, where n=the number of programs on
your disc.
Don't change anything else in line 30!!
You now need to retype the DATA at line 1000, to tell the
program the filenames of your programs.
Have ready a list of the filenames that your want on your menu,
there should be the same number as you put into line 30.
Only the filenames that LOAD your programs are needed, E.G. if
the first program LOADs and then loads other parts, only the
filename of the first part is needed.
Type these into line 1000 onwards, E.G. 1000 DATA "name 1",
"name 2","name 3" etc.
You can use any line numbers from 1000 to 1999 for this pupose.
Also note that these are not used as the filename to load, only
as the name that appears on the menu, so if you have an art
program that loads with the filename "ART", you can use
something like "ARTIST ONE" in your DATA.
Having done that, you can now type in the DATA from line 2000
onwards. This is a series of numbers which correspond to the
LOADING numbers of the previous programs. They must be typed
into the DATA in exactly the same order as the names in line
1000. So if line 1000 had "ARTIST ONE" as it's first DATA, line
2000 must have the load number for that program first.
When all the DATA is finished, re-SAVE to your disc with:-
SAVE OVER "AUTO" line 1
You will now have a menu that auto loads and runs when F9 is
pressed. To use the menu, use the up/down cursors to scroll the
program names, and the corresponding number to LOAD that
program.
All this seems very complex, but you will find that it doesn't
actually take too long to do, and gives your disc a very
professional finish.
I also find that the type of menu that reads in the directory
and displays it, is a little confusing as it displays all the
extra parts of the programs, and makes choosing one that much
more difficult.
---------------------
CROSSWORD by Eric Ireland
Eric, who does a monthly crossword for the SDC, has kindly
transferred one to SAM for us. We hope you enjoy it.
_______________________________________________
MEM$ LESSON by Brian Mumford
This is the first in what I hope to make a series, of how to use
the commands in Sam BASIC.
This month, Brian has done an article and demos on the use of
the MEM$ command.
He uses text and screens to show how the command is used, and
it's quite BREAKable, so that you can look at his listings to
see what he did. There are also plenty of REMs scattered about
to get you on the right track.
....
Link to the top of this document
Link to the main index
Link to editorial & letters
Link to files
Previous disk program notes
Next disk program notes