Naming Programs

Like all file names, A-Shell BASIC programs consist of two parts: a base name or stem, and an extension.

The base name of your program can be up to ten characters.

The extension normally identifies the type of program file, with the two major type categories being source files and compiled programs.

Source Files

The extension of your source code files can be anything you want, such as .PPP for Perry's Perilous Programs; A-Shell doesn't care. When you compile a program using A-Shell's COMPIL command, it will work on any filename you specify, such as confused2.ppp, 222much.abc, 1234567890.bas, etc.

By convention, source files are named with extensions of either BAS or BP, with the latter being recommended.

BAS is the historical extension, and has been used as the extension for BASIC programs of all types and on all platforms for many years. In the case of A-Shell, BAS always has the benefit of being automatically recognized by COMPIL. To compile a program with the extension BAS, you do not need to specify the extension; the compiler knows to look for a BAS file with the stem name you have specified. So entering "COMPIL ABC" will result in the file abc.bas being compiled, whereas the same command results in the program source file ABC.XYZ being ignored.

The other common extension is BP, and there are a few good reasons to use it instead of BAS.

•   Many email programs will not allow the sending of BAS files, recognizing them as programs. So if you ever need to send program source files via email, you should not use BAS extensions.

•   BAS is also the default source file name for Microsoft's Visual Basic programs. Since it's easier for you to rename your programs than to get Microsoft to rename its programs, not using BAS is a good idea just to avoid confusion in the Windows world.

•   BP can serve as an indicator that this program (a) was written in and for the A-Shell environment, and (b) contains A-Shell extensions which require the /X:2 switch when compiling.

•   When compiling using the /X:2 switch (use A-Shell extensions), the compiler will find and act on BP files as well as BAS files without you having to specify the extension. If you have a file abc.bp, for example, the statement COMPIL ABC/X:2 will result in abc.bp being compiled.

Compiled Programs

Compiled programs, sometimes referred to as "RUN files" or "executables," even though the latter is somewhat misleading since they need to be processed by a run-time interpreter and are thus not truly executable, must have one of the following file extensions:

•   RUN: standard programs, to be executed with the RUN command.

•   SBX: external, dynamically loadable subroutines; see Calling External Routines.

•   LIT: commands, to be executed without the RUN command.

See Edit, Compile, Run for more details on the three forms of compiled programs.