AUTOEXEC.BAS explained

STOS programming section.
Post Reply
User avatar
exxos
Site Admin
Posts: 2380
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

AUTOEXEC.BAS explained

Post by exxos » Tue May 22, 2018 12:56 pm

This file allows a STOS BAS file to auto execute when STOS loads.

For example rather than having to constantly type in the missing link registration line, this can be done automatically in the AUTOEXEC.BAS .

10 rem register missing link
20 A = mostly harmless (1,2,3,4,5)

However we would still have this file loaded in the editor. What I do is use the PUT KEY command to set up the editor a little bit..

30 put key "mode 1:colour0,0:dir$=drive$+"+chr$(34)+":\"+chr$(34)+":new`"

So now it will automatically switch to medium resolution, I set the background colour to black, the drive is set to the root folder, and the "new" command is run, which obviously clears the editor from the loaded AUTOEXEC.BAS. Noticed the small single quote ":new`" after the words new, which is the equivalent of pressing enter.

chr$(34) is the ASCII code for the double quotation marks. Obviously we cannot use quotation marks twice as PUT KEY needs quotation marks, and we also need quotation marks for the directory select. So the workaround is to use chr$(34).

For example:

Print "hello"
hello


Or we can do:

print chr$(34)+"hello"+chr$(34)
"hello"


To take things little further we can autoload ACB's like the compiler sprite editor automatically..

A complete loader would look something like this..


10 rem exxos auto acb loader
20 rem register missing link..
30 A=mostly harmless(1,2,3,4,5)
40 print "loading ACB.."
50 dir$=drive$+":\ACB"
60 put key "accload"+chr$(34)+"*.acb"+chr$(34)+":mode 1:colour0,0:dir$=drive$+"+chr$(34)+":\"+chr$(34)+":new`"

This will load automatically any ACB file located in the ACB folder.

You can of course change *.acb" to "*.*" to load everything in the folder.. But realistically we do not want to load items we will not use. So I would suggest moving the accessories you do not want to load into a temporary folder elsewhere so they are not loaded automatically.


DOWNLOAD
AUTOEXEC.zip
(485 Bytes) Downloaded 1 time
4MB STFM 1.44 FD- VELOCE+ 020 STE - 4MB STE 32MHz - STFM 16MHz - STM - MEGA ST - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - HxC - CosmosEx - Ultrasatan - various clutter

https://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.

Post Reply