THEOS Software (GB)
We are the UK distributor for THEOS Corona Operating System and companion products, including the THEOS BASIC programming language and THEO+Net network server software.
Structured development with subprograms
A powerful feature of the THEOS MultiUser BASIC programming language is its support for subprograms. Similar in form to user-defined functions, a subprogram has a number of differences which make them much more capable. These include:
Multiple Return values - a user-defined function can return only one value, so programmers were forced to use substrings or other means to return multiple values. The SUB definition allows variables to be passed by value or by reference, which allows the subprogram to return multiple values to the calling program without resorting to using shared or global variables.
Local values - by declaring all variables used within the subprogram as local, the programmer can be sure that their values will not overwrite those from the main program.
Local labels - a local line label can be declared by suffixing it with a double-colon (::) rather than the usual single colon that denotes a THEOS line label.
Using subprograms, along with the INCLUDE statement to include them into each program as required, means that duplicate code can be reduced, thus saving development time. Most developers have their own library of subprograms that can be incorporated into new software as required, and the features of a subprogram ensure that there is no need to worry about interference with the rest of the code.
Tracking dependencies
The THEOS MultiUser BASIC language also includes a MAKE command. Beloved of programmers everywhere, despite its sometimes incomprehensible syntax, MAKE allows the programmer to maintain a list which defines the relationship between programs and their included files, ensuring that any change in an included file results in the updating of the parent. Although the power of modern development machines means that it is often easiest to recompile all programs in a particular suite, a properly-maintained MAKE file ensures that mistakes cannot be made.