Skip to content

7. Thoroughbred Basic Language Overview

This chapter is divided into two parts:

  • A discussion of syntax conventions used to describe Thoroughbred Basic directives, functions, and system variables.
  • A quick reference to all Thoroughbred Basic directives, functions, and system variables. The quick reference is divided into the following categories:

Directives
Numeric functions
String functions
System variables

Entries under each category are alphabetically ordered. Each entry contains the required syntax for the directive, function, or system variable.

Full descriptions of directives, functions, and system variables are contained in the Thoroughbred Basic Language Reference. Most descriptions contain the following information:

PURPOSE
discusses how to use the directive, function, or system variable.
SYNTAX
displays how to type the directive, function, or system variable.
REMARKS
discusses things to remember and the most common errors encountered during execution.
EXAMPLES
illustrates how to use the directive, function, or system variable.
SEE ALSO
directs you to related or similar directives, functions, and system variables.

Some directives, functions, and system variables differ within operating system environments (e.g., UNIX versus MS-DOS), and from one release level to another of Thoroughbred Basic. Where possible, these differences are addressed in the REMARKS section for the directive, function, or system variable. Where the differences are too significant to simply list (e.g., DSD function) there are separate entries for the different items, noting which release level or environment is applicable.

Descriptions of Thoroughbred Basic directives, functions, and variables follow the syntax conventions described below:

CAPITALS
Words in capital letters are keywords and must be entered as shown. Thoroughbred Basic is case sensitive. This means that lowercase letters are not the same as uppercase letters. Keywords are shown in uppercase letters and must be typed in uppercase letters.
lowercase
All items shown in lowercase must be supplied by you.
[Optional]
Items in small, square brackets ([ ]) indicate optional entries. You do not have to type the item enclosed by the brackets and you do not type the brackets.
[Required]
Large, square brackets are required syntax elements. You must type them. Under some circumstances, such as when you define string arrays, Thoroughbred Basic requires you to type these brackets.
Punctuation
With the exception of . . . (ellipsis), Thoroughbred Basic requires you to type the punctuation displayed in the syntax of directives, functions, and variables. This includes commas, semicolons, colons, and parentheses. An ellipsis indicates that an item can be repeated many times.

Example:

INPUT [(channel [, i/o-options])][DIM arrayname$ [element1 [, element2 [, element3]][
[(length [, initialization-value])]

In the example above, the brackets ( [ ] ) around the elements are required syntax components: to specify at least one element you must use the brackets to enclose the specification. The other brackets ([ ]) enclose optional parameters: you do not have to specify values for those parameters; if you specify values for those parameters you do not type brackets around the specifications.

Many of the parameters in the syntax definitions in the following section accept a string variable or string constant specification. For example, you can specify file-name or program-name with a variable that contains the name of a file or program, or type in the name of a file or program. All constants must be enclosed by quotes. As an example, you can type “textfile.txt” to specify a string constant for the file-name parameter.

The following is a list of all Thoroughbred Basic directives, functions, and system variables.

XCALL “c-function” [,ERR=line-ref|,ERC=numeric-value] [,argument-list [. . .]] Enables Thoroughbred Basic programs to dynamically call c-compiled programs and pass data back and forth.
XOR (string-value1, string-value2 [,ERR=line-ref|,ERC=numeric-value]) Returns the logical exclusive OR, bit by bit, of two string expressions of equal length.

From the Thoroughbred Basic Developer Guide, version 8.9.1. Open this page in the PDF