158
INDEXED Directive
Create Indexed File
Format
INDEXED filename$,[max_recs],rec_size[,SEP=char$][,ERR=stmtref]
Where:
char$
Separator character. Hex or ASCII string value.
filename$
Name of the indexed file to create. String expression.
max_recs
Maximum number of records in the file. Optional numeric
expression. Default is no initial allocation of file space, with no limit
as to final size. 0 zero indicates that the number is dynamic. A positive
value indicates that the file is pre-sized to the specified number of
records an Error #2: END-OF-FILE on read or File full
on write will be generated if an attempt is made to add more than
this specified number of records, or access an IND= value above this
limit.
rec_size
Maximum size of the data portion of each record.
stmtref
Program line number or label to transfer control to.
Description
Use the INDEXED directive to create a file that can be accessed either sequentially or
by record number (index).
Make the record size long enough to contain the maximum record length (i.e., the
combined length of the data fields plus field separators). If you use a filename that
already exists, ProvideX returns an Error #12: File does not exist (or
already exists).
Use the SEP= option to set the default separator for a given file. Use any character
from $00$ to $FF$, or use SEP=*. When the asterisk * is set as the value, fields will
not be delimited. ProvideX writes records to the file with field type and length
headers. This feature may provide better results in overall file performance.
WindX supports the use of this directive via the [WDX] tag; e.g., INDEXED
See Also
File Types, User's Guide.
Examples
0110 INDEXED A$+"-"+B$,100,50,ERR=1090
0200 INDEXED "CSTFLE",,140
Line 0200 creates a file with the following structure:
Indexed file: C:\Program Files\Sage Software\ProvideX\CST\CSTFLE
Maximum Record size ..........: 140
Maximum # records ............: (No limit)
Current # records ............: 0