Introduction to Subroutines

AlphaBASIC programs rely heavily on the use of subroutines to perform functions from the simple STRIP (strip trailing spaces from a string) to the more complex BASORT (sort sequential and random data files). Subroutines under AMOS have the extension SBR, and traditionally live in DSK0:[7,6] (BAS:). When a program calls a subroutine, AlphaBASIC locates the SBR file, loads it if necessary, and then calls to the start of it.

Subroutine handling under A-Shell is functionally identical: your program invokes a routine, and A-Shell calls to its start. Because of the structural differences between AMOS/AlphaBASIC and A-Shell, however, A-Shell subroutines do not (normally) exist as separate SBR files; they are, instead, linked into the A-Shell object module and are therefore always available.

A-Shell comes with several hundred subroutines, including nearly all of the so-called Alpha Accounting routines from [7,60] and the so-called "standard AlphaBASIC subroutines" from [7,6]. It also includes the most popular MicroSabio subroutines for AMOS, (INFLD, INMEMO, EZSPL, MSBOXX), plus a variety of routines that have been written specifically for A-Shell. In addition, A-Shell includes many third-party subroutines that have been converted over the years as more firms and developers have migrated to A-Shell and we have converted their AMOS routines.

This document lists the most commonly used routines, and provides detailed documentation for most of them. Those not listed were skipped because they are too obscure or are specific to individual users. Recently-added routines, which come around fairly often, are usually documented even if they are obscure and/or for specific users.

If there is a function that you need and do not see, be sure to inquire about it before writing your own.