Skip to content

BASIC XL Toolkit & Runtime Package

The BASIC XL Toolkit is a group of programs written to demonstrate some of the features of BASIC XL and to teach some of the basic features of BASIC programming. The diskette also contains the BASIC XL Runtime Package, which is a stripped-down version of BASIC XL. More on this later. Also included is an enhancement to BASIC XL, which when used will give you 6 new commands (keywords) for BASIC XL. 

First of all, I would like to comment on the thorough job that OSS Precision Software has done in the documentation for this toolkit. I get the feeling that OSS feels that the users of this toolkit will be beginners and not the advanced user. Each program has a good description of how the program works and what it is trying to accomplish. The other two toolkits that are produced by OSS (the MAC65 Toolkit and the Action Toolkit) are not this thorough, even though they contain sample programs. It’s unfortunate that they can’t spend the same amount of time and money to produce good documentation for these other programs, since advanced users can use good documentation too. 

The Runtime package that comes with this toolkit is BASIC XL without the editing capabilities of the cartridge. The command set is complete except for the commands LIST, NEW, RENUM, TRACEOFF, ENTER, DEL, TRACE, and LVAR. If you name the runtime package as the AUTORUN.SYS file on a disk and then name the BASIC XL program AUTORUN.BXL, your program will be automatically loaded on booting of the system. 

THIS IS THE ONLY WAY THAT YOU CAN GET THE BASIC XL RUNTIME PACKAGE TO LOAD A PROGRAM WHEN FIRST RUN. 

If you wish to run a group of BASIC XL programs, you will have to create some kind of a menu program (or use the one on the disk) and call that menu program AUTORUN.BXL. Then you can choose which program you want from the menu. 

The runtime package will handle any trapped errors properly and any untrapped errors will give you the message to hit START to perform a RunTime Restart, which is the same as typing RUN if you were using the cartridge BASIC XL. The only incompatibility is the fact that the runtime package cannot use the bank select ROM that the BASIC XL cartridge uses, so instead of being 8 kilobytes long, it is 11 kilobytes long. This could cause some problems if your program is large. 

The sample programs included with the toolkit are written so that they will run without errors, but they are not totally trapped like a commercial program should be. They are written so that you can study the techniques used to demonstrate the particular programming problem. The subroutines used could be used in your own program as is, or you could modify the programs to fit your particular needs. OSS recommends that you change the programs to make them work better. This is an excellent way to learn programming. 

So many times, people ask me for answers to questions that they have. Many times they indicate that they have an idea how the change should be made, but they are afraid to make the change. If they made the change, they would many times find out that it would work. Don’t be afraid to experiment. I learned to program by typing in programs, and then changing them. If you can change it to do what you want, you probably understand how it works. 

The example programs include: 

  • SNAILS TRAILS 
  • GTIATEST 
  • CIRCLES 
  • LEM (these are game or graphics programs) 
  • PICOADVENTURE (an adventure game) 
  • CONFIG and DISKIO (disk drive access and configuring programs) 
  • BLACK BOX (an application program that demonstrates random access and keyed-access files) 
  • MENU and MAKEAUTO (two utility programs) 

Each program is documented in the manual that comes with the BASIC XL toolkit. Many of the programs have descriptions on a line-by-line basis of the operation of the source code. Very useful for beginners and advanced users alike. 

The program BLACK BOX is a mailing list program that uses the NOTE and POINT commands of BASIC XL. This program demonstrates how to create a small database management system. I remember the first database management system that I wrote about 2 years ago. It took me about 3 months. I knew nothing about structured programming so the source code is a nightmare to try to read, even today. 

I kept running into certain problems, such as how to append another name onto the database, and would spend every night for about 5 hours for a week trying to get a particular section of code to work. I now know why the code didn’t work. It is a bug in the Atari DOS. The documentation that deals with BLACK BOX goes into a great amount of detail in what a random access file is and how the Atari operating system really doesn’t support random access, but supports indexed sequential access. 

They explain the difference between the two types of data files. They then tell you how to set up index files and data files. They tell you the most efficient way to store the locations of the record in the index file. The explanation is extremely clear and concise. I wish that I had had this type of information when I set up my first database. I didn’t use some of the techniques that they used, and if I was still using that program I would go back and change the format of my index file. They also show the difference between BASIC XL’s RGET, BGET and RPUT, BPUT. 

The other demo files are explained equally well. 

The extended commands that are available on the toolkit disk deal with sorting and procedure calls. What are extended commands? Well, it seems that OSS, in its infinite wisdom, saw fit to include some “hooks” in the BASIC XL cartridge that a programmer could use to add some more commands (or keywords). This makes BASIC XL even more flexible than originally thought. 

The sorting commands include SORTUP and SORTDOWN. These are two sort commands that can be used only on string arrays. The sort routines sort on the basis of the characters’ ATASCII code. 

For those of you unfamiliar with the ATASCII code, let me point out some problems that this can create. If you have in a string array with the string elements apple, Zebra, and ZOO, you would probably think that they would appear in the above order (assuming that they are being sorted in ascending order). If you use the SORTUP command on this string array, the order that you will receive is: 

  1. ZOO
  2. Zebra
  3. apple  

Oops, what happened. If you will pull out an ATASCII chart you will find that the order of the ATASCII code is upper case letters, lower case letters, and numbers. 

All this means is that you will have to use some caution on how deep you sort (how many letters of the string variable you will use in your sort) and what case the letters are in. You may want to convert all of the letters to upper case, for instance. 

The SORTUP and SORTDOWN functions allow you to specify what part of the string you want to sort. For instance, you could sort a string array starting with the 2nd element in the array, and sorting the 4th through the 8th characters of each string. This will give you great control over the use of the sort commands. 

One other thing of interest with the sort functions is the fact that you cannot directly sort numbers with it. If you tried to sort the group of numbers 1, 2, 3, 5, 22, 333, and 444, you would get: 

1 
2 
22 
3 
333 
444 
5  

Hardly the results that we wanted. The way around this is to pad the string with zeros so that the length of the string is the same. This way when the sort is done, the zeros will be insignificant. 

An example of some code to do this would be: 

					300 DIM STRING$(5,10) 
310 FOR I = 1 TO 5: INPUT N:STRING$(I;) = "0000000000" 
320 STRING$(I;11-LEN(STR$(N)))=STR$(N): NEXT I 
330 SORTUP STRING$ 
				

This will allow the sort to proceed in the correct manner. You may want to get rid of the leading zeros before you print the number. If you use the VAL statement, the leading zeros will be ignored and you will once again have a numeric variable. 

The usefulness of this function can be seen quite easily, but it has very little power if you compare it to the other functions that are included in the extended commands of the BASIC XL toolkit. 

The procedure oriented extended statements are: 

PROCEDURE 
CALL 
LOCAL 
EXIT  

They are used to set up PROCEDURES similar to a PROC or FUNC in Action. Instead of using a GOSUB statement with a RETURN, you may name subroutines with the PROCEDURE command. This is a very easy way to make your code very readable, and therefore easy to modify. 

The PROCEDURE command will define the starting location of the subroutine. It also may define several variables that may be passed to the PROCEDURE. This makes it so that you do not have to define a variable before you use it in a subroutine. The PROCEDURE will treat all variables named within it as LOCAL variables. This means that any variable within the PROCEDURE will not change the value of any variable outside the PROCEDURE, even though it may have the same name. 

If your variable is acted on inside the PROCEDURE, you can make it return the value that was assigned to it while inside the subroutine. The manual goes into a lot of detail about how PROCEDUREs treat variables and how you can cause some real problems if you are not careful. 

The CALL command allows you to call a PROCEDURE. This is similar to the GOSUB command. The line number would be similar to the PROCEDURE name. One of the problems with the CALL command is that they are slow, especially if you are passing several variables to the PROCEDURE that you are calling. 

The manual warns that a GOSUB with the FAST command will be faster than the CALL command. If you are passing a large amount of variables to the PROCEDURE, the CALL command may be faster than the GOSUB command in the normal mode. This means that the FAST command will not work with the extended commands. 

The LOCAL command is used to define local variables. These can be used in a certain area of your program to represent one thing and in another area to represent something else. They will not interfere with each other so they will act like two different variables. This can be useful when you are getting close to the 128 variable limit that BASIC XL and Atari BASIC place on a program. 

The EXIT command is used to signify the end of a PROCEDURE or the end of an area where a LOCAL variable is defined. The EXIT command can return a value to a certain variable. 

The BASIC XL Toolkit contains a lot of information on how to use BASIC on the Atari computer. I learned a lot by just reading the manual. The way that each sample program is documented is a real help to understanding the way a program works. I am not sure how much I would use the Procedure commands, but they are an interesting concept and could be very useful under the right conditions. 

The SORT commands on the other hand could be used in a lot of places and would cut down on the time necessary to load my machine language sort routine from a BASIC program. I would recommend the package to anyone that wants to learn more about using the BASIC XL cartridge. 

By the way, for those of you that don’t have BASIC XL, what are you waiting for? I don’t use Atari BASIC for anything anymore! 

Editor’s Note 

The list price of the BASIC XL Toolkit is $39.95. The Extended Commands supplied with the Toolkit require BASIC XL version 1.02. If you don’t have version 1.02, and sent in your Software Registration Form for BASIC XL, you can get an upgrade for $15.00. Instructions on how to do this are included in the Toolkit documentation. 

Getting this upgrade seems a little easier than most, because if you buy the Toolkit first, and set up a disk (or 2, or 3 or …) with the RunTime Package, you can still run your programs while the cartridge is in transit. 

PHOTO CREDITS: