Readers’ Feedback
If you have any questions, comments, or suggestions you would like to see addressed in this column, write to "Readers' Feedback," COMPUTE!, P.O. Box 5406, Greensboro, NC 27403. Due to the volume of mail we receive, we regret that we cannot provide personal answers to technical questions.ST Resources
Whenever I try to run ST BASIC from an AUTO folder, I get the message Can't find BASIC.RSC, and the computer refuses to load BASIC. When I remove BASIC from the AUTO folder, it loads as usual. What is wrong?
- Herschel Lee
In the first place, ST BASIC falls in that group of GEM-based programs which you can't run from the AUTO folder. As noted in the November 1986 installment of this column, the ST runs programs from AUTO before it installs the GEM operating system interface, so it's impossible to autorun any program that depends on GEM's windows, menus, or mouse. Your letter also raises a more general issue concerning ST resources. Many GEM programs, including ST BASIC and 1st Word, rely on a separate resource file in addition to the file that contains the program itself. If the resource can't be loaded, the program can't run and usually aborts with an error message like the one you saw. A resource file has the same filename as the program, but a different extension (.RSC instead of .PRG). Whenever you copy a program to a new disk or directory, check to see whether it has a resource file; if it does, you should copy the resource (BASIC.RSC, in this case) to the same destination. What's in a resource file? BASIC.RSC contains everything BASIC needs to create its drop-down menus. In addition to menus, a resource can include selection buttons, custom icons, printed text, and editable text fields (areas where you can enter or change text). Handling interactive dialogs with a resource saves an enormous amount of programming effort, since GEM automatically performs jobs such as displaying a dialog box, managing the interaction, and saving and restoring the screen area overdrawn by the box. Resource files are usually created and edited with a program known as a resource editor. The Atari ST development system includes such an editor, known as the Resource Construction Set. Some other development systems include similar editors. There are several reasons why a program might use a resource file. Programming convenience is an obvious consideration. Most interactive dialogs require complex data structures which are easy to create with a resource editor, but quite tedious to program from scratch. TheST Programmer's Guide, available from COMPUTE! Books, has an example program that creates its own menus—not a simple process, even for an experienced programmer Flexibility and portability are equally important factors. If the resource is in an .RSC file, you can change it by simply editing the file rather than rewriting the program. For instance, to create an Italian language version of an English program, you could change the text in the program's resource from English to Italian with a resource editor. Similarly, an often-used resource is easy to include in a new program if it's in an .RSC file. Instead of including large amounts of code to create the resource, the new program can include only what's needed to load and manage the resource.