My usual header...
10 rem EG extension installerWork in mode 0 to gain more colours.
20 rem By Martin Cubitt
30 rem 15th October 1993
40 rem
50 rem Last update: 17/10/1993
60 rem
100 curs off : palette $0,$0,$0,$0,$0 : mode 0 : key off : hide :flash offDisplay options.
110 pen 7Set palette once screen writing complete.
120 paper 8
130 centre " EG extension installer "
140 pen 9
150 paper 0
160 locate 0,5
170 centre "Select from one of the following"
180 pen 4
190 paper 6
200 locate 0,10
210 centre " 1. Install INTERPRETER extension "
220 locate 0,12
230 centre " 2. Install COMPILER extension "
240 locate 0,15
250 centre " 9. Exit "
260 pen 9
270 paper 0
280 locate 0,19
290 centre "Press the number of your choice"
300 wait vbl
310 palette $113,$777,$0,$0,$632,$273,$321,$362,$231,$557,$666,$333Wait for option number to be pressed from one of 3 defined.
320 clear key
330 repeatJump to line depending on option selected.
340 : OPTION=instr("129",inkey$)
350 until OPTION>0
360 on OPTION goto 1000,2000,9000Install interpreter...
998 rem --------------------------------------------------------Sets up file name to save, size of file to be saved, memory bank where extension is and the folder for the extension.
999 rem * INSTALL: Interpreter extension *
1000 FILENAME$="eg.exw"Install compiler...
1010 FILESIZE=691
1020 BANK=5
1030 FOLDNAME$="STOS"
1040 gosub 3000
1050 goto 320
1998 rem --------------------------------------------------------Actual routine to install...
1999 rem * INSTALL: Compiler extension *
2000 FILENAME$="eg.ecw"
2010 FILESIZE=318
2020 BANK=6
2030 FOLDNAME$="COMPILER"
2040 gosub 3000
2050 goto 320
2998 rem --------------------------------------------------------Ensure file name in upper case.
2999 rem * INSTALL: An extension *
3000 FILENAME$=upper$(FILENAME$)Allow selection of disc and path.
3010 pen 11
3020 locate 0,23
3030 centre "Enter EXIT not to install "+FILENAME$
3040 pen 10
3050 paper 0
3060 MSG$="Select "+FOLDNAME$+" folder"
3070 showClear previous message.
3080 SELECT$=file select$("*.*",MSG$)
3090 hide
3100 locate 0,23
3110 centre space$(len("Enter EXIT not to install "+FILENAME$))Catch all errors.
If EXIT entered abort s`install and go back to main menu.
3120 if upper$(SELECT$)="EXIT" then 3160
3130 on error goto 3500Save (install) extension.
3140 bsave FILENAME$,start(BANK) to start(BANK)+FILESIZEIn case of error make loud noise and try again.
3150 on error goto 0
3160 return
3499 rem Error, just return to folder selectEnd of program, no frills!
3500 on error goto 0
3510 resume 3520
3520 boom
3530 goto 3070
8999 rem --------------------------------------------------------This was a particularly simple example. You may wish to also include a manual document with your extension explaining in detail what the commands can do. Save this to another bank and treat much like an interpreter or compiler extension.
9000 default
9010 end
You may also wish to add fancy graphics or music. The current install program for my EXTRA extension (version 1.87 at time of writing) has a serious problem when exiting. It seems to the size of the sample combined with what the program does that causes problems. Some versions before 1.87 had a major problem with the installer in that it would not quite run on a half meg machine! I have to admit this is a little crazy when the bells and whistles of a program (unnecessary to its functioning) cause it not to work. I have reduced the sampled sounds and it now runs on a half meg from the AUTO folder.
So keep your installer pretty but do not overdo it. More error detection could be applied to my example and a check to see of disc memory id free and if the file already exists to give a confirmation of the overwrite.
I hope that this series has been of some use to you all. Any problems can be directed to me but I admit openly that my knowledge of STOS extensions is very limited. As I have said many times before, contact Mandarin for definite instructions.
Good luck, I hope to see extensions cropping up from all areas now. Remember, don't mix extensions id's and please do not create an extension (such as this) with only a few commands on. It is a waste of an entire extension.
By the way, I do not expect people to keep this extension on their STOS discs so the W id is still free!
Martin.