Skip to content

INDEXED

Define INDEXED File

This directive is used to create a new, sequential data file in a logical disk directory.

INDEXED file-name, num-records, record-size, disk-num, sector-num
[,ERR=line-ref|,ERC=error-code]
file-name
is any string of 8 characters or fewer used to name this file.
num-records
is an integer in the range of 1 to 16,777,215 indicating the maximum number of records to be contained in this file.
record-size
is an integer in the range of 4 to 32767 indicating the number of bytes in each record in this file.
disk-num
specifies the logical disk directory that contains this file. Valid values are 0 through 35.
sector-num
is required but the only valid value is 0.
line-ref
is the program line number or label to branch to if this directive produces an error.
error-code
is a programmer-defined error code. Valid values are positive or negative whole numbers.

If any integer range is exceeded, an ERR=41 results.

If a file-name of more than eight characters (operating system-dependent) is specified, an ERR=10 results.

File-name must be unique in the execution environment. An attempt to define a file having the same name as another file that is already defined on an available logical disk directory results in an ERR=12.

File-name may contain any ASCII characters, unprintable as well as printable. Avoid using characters, which have special meaning in different operating system environments (e.g. “*” in UNIX and DOS, “/” in UNIX, “#” and “\” in DOS, etc.).

Do not use device or task names as file names. For example, do not use T0-T9, TA-TZ, Ta-Tz, D0-Dz, LP, P0-Pz, G0-Gz, or C0-Cz. In general, most device and task names use two-character names. The simplest approach is to not use two-character file-names.

All valid values for sector-num are treated as 0, but syntax requires sector-num to be specified.

INDEXED "SEAL", 57, 26, 2, 0

creates an INDEXED file named “SEAL” with 57 records with a length of 26 bytes each, and a location on logical disk 2 starting at a sector allocated by the operating system.

INDEXED A$, A, B, C, D, ERR=7999

If A$=“SEAL”, A=57, B=26, C=2, D=0, has the same effect as the first example, and branches to statement 7999 if this directive produced an error.

ADDSORT, DIRECT, ERASE, FILE, INITFILE, MSORT, REMSORT, SERIAL, SORT, TEXT, and TISAM directives

From the Thoroughbred Basic Language Reference, Volume II: F–Q, version 8.9.1. Open this page in the PDF