Directives
INDEXED 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 writewill 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 statement label to which to transfer control.
 
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.


*Note* As of Version 4.20, WindX supports the use of this directive via the [WDX] tag; e.g., INDEXED "[WDX]somefile.ext"... If you are running an earlier version of ProvideX on a WindX PC, you still need to encapsulate the command in an EXECUTE


"[WDX]..." directive. See [WDX] Direct Action to Client Machine.
 
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:\OTHER\MANUALS\PVX\CST\CSTFLE
Maximum Record size ..........: 140
Maximum # records ............: (No limit)
Current # records ............: 0