ROOT

ROOT


ROLLBACK WORK Index Level RQM
Syntax ROOT file.reference,a.code TO root.variable {THEN | ELSE statement.block}
Category BASIC
Type Statement
Description provides an interface to the b-tree indexes for subsequent references with the "key" statement.

This is somewhat like an "open", in that the statement establishes the root fid of the given index and assigns it to the "root.variable". Subsequent use of the "key" statement references the corresponding "root.variable". Any number of indexes may be "open" at once, provided that each has a unique "root.variable".
The "a.code" is a string expression containing the "a" (algebraic) processing code located in the file-defining item which identifies the index to use. The index must have previously been created with "create-index".

"root.variable" is for use by subsequent "key" statements.

The optional "then" clause is executed if the specified index is found. The "else" clause is executed if it is not found.

The "key" statement, in conjunction with the initializing "root" statement, provides the ability to sequentially cruise on any defined index for a particular file.

The "root" statement must precede the "key" statement.

See the "then/else construct" for an explanation on the use of "then" and "else" clauses in statements that allow or require them.
Options
See Also statements & functions THEN | ELSE statement.block clear-index create-index statement.block b-tree a (algebraic) file.reference KEY
Example See "key".
Warnings
Compatibility D3 7.0 AP
ROLLBACK WORK Index Level RQM