AUTOEXEC.BAS explained

STOS programming section.

Moderator: troed

Post Reply
User avatar
exxos
Site Admin
Site Admin
Posts: 23495
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

AUTOEXEC.BAS explained

Post by exxos »

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 204 times
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
Post Reply

Return to “STOS”