Skip to content

Thoroughbred Basic Language Reference

Version 8.9.1 · Volume I: A–E (PDF) · Volume II: F–Q (PDF) · Volume III: R–Z (PDF)

Thoroughbred Basic is a business BASIC designed to meet the needs of developers who design, code, enhance, and maintain business applications. The Thoroughbred Basic language is part of the Thoroughbred Environment, part of the Thoroughbred 4GL Environment, or part of the Thoroughbred OPENworkshop Environment.

The Thoroughbred Basic Language Reference consists of three volumes that contain full descriptions of Thoroughbred Basic directives, functions, and system variables. This manual is a companion to the Thoroughbred Basic Developer Guide, which contains a summary of concepts implicit in the Thoroughbred Basic language and descriptions of how Thoroughbred Basic can interact with site hardware and software. The Thoroughbred Basic Language Reference assumes knowledge of the BASIC language, programming concepts, and program development procedures.

The Thoroughbred Basic Language Reference and the Thoroughbred Basic Developer Guide are part of a Thoroughbred Software International documentation library that includes the Thoroughbred Basic Quick Reference Guide, the Thoroughbred Basic Installation and Upgrade Guide, the Thoroughbred Basic Customization and Tuning Guide, and the Thoroughbred Basic Utilities Manual.

BOLD FACE/UPPERCASE
Commands or keywords you must code exactly as shown. For example, CONNECT VIEWNAME.
Italic Face
Information you must supply. For example, CONNECT viewname. In most cases, lowercase italics denotes values that accept lowercase or uppercase characters.
UPPERCASE ITALICS
Denotes values you must capitalize. For example, CONNECT VIEWNAME.
Underscores
Displays a default in a command description or a default in a screen image.
Brackets [ ]
You can select one of the options enclosed by the brackets; none of the enclosed values is required. For example, CONNECT [VIEWNAME|viewname].
Vertical Bar |
Piping separates options. One vertical bar separates two options, two vertical bars separate three options. You can select only one of the options
Braces { }
You must select one of the options enclosed by the braces. For example, CONNECT {VIEWNAME|viewname}.
Ellipsis . . .
You can repeat the word or clause that immediately precedes the ellipsis. For example, CONNECT {viewname1}[ [, viewname2] . . . ].
lowercase
displays information you must supply, for example, SEND filename.txt.
Brackets [ ]
are part of the syntax and must be included. For example, SEND [filename.txt] means that you must type the brackets to execute the command.
punctuation
such as , (comma), ; (semicolon), : (colon), and ( ) (parentheses), are part of the syntax and must be included.

Directives, functions and system variables

Section titled “Directives, functions and system variables”
Name Description
ABS Absolute Value
ACS Arc Cosine
ADD Add Filename
ADDR Add Memory-Resident Public Program
ADDSORT Add New Sort Sequence
=ALL Equal Repeated Character
AND Logical AND
API Interface to the Microsoft Windows API
ARG Arguments for Thoroughbred Basic Startup
ARGC Argument Count for Thoroughbred Basic Startup
ASC Returns Integer Value of ASCII Character
ASN Arc Sine
ATH ASCII to Hexadecimal
ATN Arc Tangent
ATQ Arc Tangent of a Quotient
ATR Returns Attribute Value of a Data Element
BEGIN Begin Program Environment
BIN Binary
BREAK Abort Loop Control
BSZ Bank Size
CALL Call a Public Program
CDN Returns Current Date in SQL Numeric Format
CDS Returns Current Date in SQL String Format
CGV Common Global String Variables
CHR Converts Integer to ASCII Character
CLEAR Clear Program Environment
CLEAR ERC Clear Error Condition Variable
CLOSE End I/O Channel Operations
CMASK Foreign Currency Parameters
COMMIT Make Database Changes Permanent
CONTINUE Next Iteration of a Loop Control
COS Cosine
CPL Compile Thoroughbred Basic Statement to Compiled Format
CPP Compile Program
CRC Cyclic Redundancy Code
CTC Commit Count
CTL Control Key Variable
CVT Convert String
DATEMASK SQL Datemask
DATESTRINGS SQL Month and Day Names
DAY System/Task Date
DCM Data Compress
DEC Return Decimal Value of ASCII String
DEF FN Define Function
DELETE Delete Program Statements
DELETE ARRAY Delete Array Elements
DIM (numeric array) Dimension Numeric Array
DIM (string) Dimension String
DIM (string array) Dimension String Array
DIM (string function) Dimension String Function
DIR Current Directory Variable
DIRECT Define Single-Keyed Access File
DISABLE Prevent Logical Disk Access
DNE Data Name in Error
DROP Drop Filename from File Table
DROP ALL Drop All ADDRed Filenames from File Table
DSD Device Status Description
DSK Current/Configured Disk Drives
DSZ Data Size (Available User Memory)
DTN Date/Time Numeric
DTR Data to Record Conversion
DUMP Dump Data and Environment Information
EDIT (full screen) Full Screen Program Editor
EDIT (line) Program Line Editor
EDIT (recall) Recall Last Command for Editing
EDITF Formatted Program Editor
ENABLE Allow Logical Disk Access
ENCRYPT Encrypt Program File
END End Program Execution
ENDTRACE End Program Trace Mode
ENTER Public Program Entry Point
EPT Base 10 Exponent
ERASE Erase File
ERC Error Condition Variable
ERM Error Message
ERR (function) ERR Function
ERR (variable) ERR Variable
ERRBUF Error Buffer
ESC Escape Character
ESCAPE Escape Program Execution
ESCAPE WHEN Conditional Escape from Program Execution
ESCOFF Escape Trapping Off
ESCON Escape Trapping On
EXECUTE Execute Thoroughbred Basic Console Mode Instruction from Program
EXIT Exit from Public Program
EXITTO Unconditional Branch and Clear Return Address
EXP Natural Logarithm Exponent
EXTRACT Read Data and Lock Record
Name Description
FDT Open File Table Entries
FID File Identification
FILE Define a File from File Identification
FIND Read Data if Present
FINPUT Field Input
FIX Special Integer Function
FIXUP Fix Up Program File Structure
FKY First Key
FLOATING POINT Exponential Numeric Mode
FMD Retrieves a Portion of the Data Area of a Format
FMT Retrieves Data Name from String
FMTNL Format Name List
FN Invoke User-Defined Function
FOR/NEXT Loop Controlled by Counter
FORMAT DEFAULT Initialize Format Data Elements and Load Values
FORMAT DELETE Remove Format from Memory
FORMAT INCLUDE Load Format from Data Dictionary into Memory
FORMAT INIT Initialize Data Elements of Included Format
FPT Fractional Portion
FST File System Information
GAP Generate Odd Parity
GET Read Disk by Sector
GOSUB Branch to Subroutine
GOTO Unconditional Program Branch
HSH Hash
HTA Hexadecimal to ASCII
IF/THEN/ELSE/FI Conditional Test
IND Index
INDEXED Define INDEXED File
INF System and Task Information
INITFILE Initialize File
INPUT Read Terminated by Keystroke
INSERT ARRAY Insert Array Entries
INT Integer
IOL( ) Pack All the Values of IOLIST into One String
IOLIST Input/Output Variable List
IOR Binary Inclusive OR
KEY Key Value
LEN String Length
LET – variable assignment Variable Assignment
LET – array copy Array Copy
LET FMD Store String Value into Format’s Data Area
LET FMT Assigns String Value to Data Name
LIST List Program Statements
LKY Last Key
LOAD Load Program into Memory
LOCK Lock File for Exclusive Use
LOG Logarithm
LOG CLOSE Close Transaction Log File
LOG OPEN Open File for Log File Entries
LONGVAR Long Variable Name Entry Mode
LRC Longitudinal Redundancy Check
LST Convert Thoroughbred Basic Statement to List Format
MAX Maximum Numeric Value
MERGE Merge Program Lines from Separate Sources
MIN Minimum Numeric Value
MNE Mnemonic
MOD Modulus (Division Remainder)
MSORT Define Multi-Keyed File
NEA String/Numeric Array Data
NLG Natural Logarithm
NMV Numeric Value
NOT Binary Inversion
NTD SQL Number to String Date
NUM Numeric
OCH Open Channel
ON GOSUB Conditional GOSUB
ON GOTO Conditional GOTO
OPEN Open a File on I/O Channel
PACK ARRAY Pack String Array into String
PAD Justify and Pad String
PCK Pack Integer into String
PEXTRACT Previous EXTRACT
PFL Prepare for Listing
PFP Prepare for Program
PGCHARBASE Portable Graphics Character Base
PGM Return Thoroughbred Basic Statement in Compiled Format
PGN Program Name
PKY Previous Key
POS Return Position of Substring
PRC PRECISION Variable
PREAD Previous READ
PRECISION Set Numeric PRECISION
PREFIX Prefix Path Names
PRINT Output to Printer/Terminal
PRM Gets PRM Options That Are Flags
PROGRAM Define Program File
PSAVE Protected Save
PSZ Program Size
PTN Memory Partition Size
PUB Public Program
PUT Write to Disk by Sector
QUO Double Quote Character
Name Description
READ Read Data from I/O Channel
RELEASE Terminate Task Operation
REM Remarks
REMOVE Remove Record from File
REMSORT Remove Sort Sequence
RENAME Rename File
RESERVE Reserve Logical Disk for Exclusive Use
RESET Reset Program Environment
RETRY Retry Statement That Caused Error Branch
RETURN Terminate Subroutine
RND Random
ROLLBACK Cancel Database Changes
RTD Record to Data Conversion
RUN Run Program
SAVE Save Program to Disk
SDX Soundex Value of String
SEP Field Separator Character
SERIAL Define SERIAL File
SET CMASK Change Foreign Currency Parameters
SET CTC Set Commit Count
SET CTL Assign a value to CTL variable
SET DATEMASK Change SQL Datemask
SET DATESTRINGS Change SQL Month and Day Names
SETDAY Change System/Task Date
SET DIR Set Current Directory
SETDRIVE Change Default MS-DOS Disk
SET ERC Set Error Condition Variable
SETERR Set Error Branch
SETESC Set Escape Branch
SET HOTKEY Set Hotkey Value and Program to Execute
SET PREFIX Set Prefix Path Names
SET PRM Set PRM Options That Are Flags
SET TERM Load a Terminal Table
SETTIME Set System/Task Time of Day
SETTRACE Start Program Trace Mode
SET TRACEMODE Sets Mode of Tracing
SFMTNL Soft Format Name List
SGN Determine Sign of Numeric Value
SHORTVAR Short Variable Name Entry Mode
SIN Sine of an Angle
SORT Define SORT File
SQR Square Root
SSN Software Serial Number
SSZ Sector Size
START Initiate Task
STL String Length
STOP Stop Program Execution
STR Convert Numeric to String Value
SWP Byte Swap
SYMTAB Program Symbol Tables
SYS System Name
SYSTEM Temporary Exit to Operating System
TABLE Data Conversion Table
TAN Tangent
TBL Table Function
TCB Task Control Block
TEXT Define System TEXT File
TFF
TIM Task Time in Hours and Decimal Hours
TISAM Define Thoroughbred ISAM File
TRACEMODE Set Tracing Mode
TRANSACTION BEGIN Begin Tracking Record Changes
TSK ( bank-num ) Bank Task Data
TSK (0) System Task Data
TSK (2) Report Active Ghost Tasks
TSK (3) List Active Terminal IDs
TSM Termination Status Message
UCM Uncompress Data
UNLOCK Unlock I/O Channel
UNPACK ARRAY Puts Packed String into String Array
UNT (function) Lowest Channel Number for File
UNT (variable) Unused Channel
UPK Unpack Integer from String
WAIT Suspend Operation for Specified Time
WHILE/WEND Loop Controlled by Conditional Test
WIN ( GET ) Collect Thoroughbred Basic Window Data
WIN ( GETCURSOR ) Get Thoroughbred Basic Window Cursor Position
WIN ( GETLIST ) Get List of Active Thoroughbred Basic Windows
WIN (GETSAVEDLIST) Get List of Saved Thoroughbred Basic Windows
WIN ( GETSCREEN ) Get Attributes for Entire Screen
WINDOW ATTR Set Thoroughbred Basic Window Attribute
WINDOW COLOR Set Thoroughbred Basic Window Color
WINDOW CREATE Create Thoroughbred Basic Window
WINDOW DELETE Delete Thoroughbred Basic Window
WINDOW FKEYS Reload Function Keys
WINDOW GETINFO Get Thoroughbred Basic Window Manager Status
WINDOW IOREGION Create Protected Region
WINDOW MOVE Move Thoroughbred Basic Window
WINDOW PANEL Define Protected Panel
WINDOW POP Delete Current Thoroughbred Basic Window
WINDOW PUSH Create Duplicate of Thoroughbred Basic Window
WINDOW PUT Reprint Current Thoroughbred Basic Window
WINDOW REFRESH Reprint Entire Screen
WINDOW RESIZE Change Thoroughbred Basic Window Size
WINDOW RESTORE Reprint/Activate Thoroughbred Basic Window
WINDOW SAVE Save Thoroughbred Basic Window
WINDOW SCROLL Move Data in Thoroughbred Basic Window
WINDOW SELECT Activate Thoroughbred Basic Window
WINDOW SHAPE Draw Shape in Thoroughbred Basic Window
WINDOW SWAP Exchange Active Status
WINDOW WRAP Change Wrap Attribute
WRITE Write Data to I/O Channel
XCALL Call External Programs
XFD Extended File Identification
XOR Binary Exclusive OR