A better organised system is what's on the menu thanks to this routine from Zach Jones that sorts out your disk programs.
On The Menu
A better organised system is what's on the menu thanks to this routine from Zach Jones that sorts out your disk programs
When you have a disk full of all of those games from PCN, you may find that you get a bit fed up with typing:
LOAD "SPACE INVADERS", 8
RUN
every time you want to run that particular program.
The program listed here generates a menu of all the RUNable programs on the disk (the right-hand side of the directory has the letters PRG) and displays these options on the screen ready for selection. The program is then loaded and run.
How It Works
First, the program pauses for one second, waiting for you to hit the letter G. Then it reads the current disk directory and generates a sequential file called MENU.DAT on the disk. This file contains all the names of files with the file type "PRG".
When a normal execution of the program is made, i.e. the G key is not pressed, the program simply reads the file MENU.DAT and displays those options on the screen. A selection is made, and the program is loaded and run.
Using The Program
Whenever you put a new program onto the disk that you wish to be available from the menu, run the menu program and use the G option to generate the new menu. The new program can now be loaded from the menu without any further difficulty.
It may be that the programs on the disk are larger than the Menu program. Wherever the END statement is in these programs, simply replace it with a LOAD"MENU",8. Then, when you leave these programs, control will be passed back to the Menu program automatically.