Classic Computer Magazine Archive ANTIC VOL. 6, NO. 9 / JANUARY 1988

GFA BASIC Loader

Converts virtually any ST file!

By PATRICK BASS, ST Resource Technical Editor

In future issues, the ST Resource will be offering small, helpful programs written for the Atari ST written in languages you may not have. If you don't have an interpreter or compiler for a program's language, it would ordinarily be impossible to use-a big waste of your time.

To prevent this from happening, here's a two-part program that will let you type in almost any ST program- or even pictures and other non-program files-in GFA BASIC.

RABBITS IN HATS
There's no magic involved. The first program, PART_ A.BAS, takes an ST disk file and converts it into GFA BASIC data statements. We'll run this program on a file we want you to type in from the magazine-or you can use it yourself on files you want to send in hardcopy form to friends. Once the program is in the form of data statements, it's easy to type in to GFA BASIC-and the second program, PART_B.BAS will rebuild the original file.

USING IT UP
Let's walk through what you need to do to convert a small file to data statements and then back again. For our demonstration, we'll use DESKTOP.INF. (If you don't have a DESKTOP.INF file on your disk, click on Save Desktop from the main Desktop and it will create the file.)

First, type in and run the program in Listing 1, PART_A.BAS, under GFA BASIC. When you run the program, a file selector box appears, asking for the file to convert. Select your DESKTOP.INF file, and the program will convert the file to data statements and write them back to the disk as DESKTOP.LST. Indeed, any file converted is given the original file's name with ".LST" as the new extender. This new file, DESKTOP.LST, is a typable, listable program file, as you'll find if you load it into GFA BASIC.

Now type in Listing 2, PART_B.BAS. This program isn't complete-before you run it, you must merge in the DESKTOP.LST file that you just created. Once you've done that, all you have to do to recreate the original file is perform the procedure call @Recreate(Filename$), where filename$ is the name you wish to recreate the original file under.

To recreate DESKTOP.INF, type in the line @Recreate ("DESKTOP.INF"). The disk will whir for a few seconds, and when you check the disk directory you will find DESKTOP.INF faithfully recreated on the disk.

Listing 1   PART_A.BAS
Listing 2   PART_B.BAS
On Disk   PARTA.BAS Download
, PARTB.BAS Download
, PARTA.PRG Download