[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
+---------------------------------+
|            LOOKUP()             |
+---------------------------------+
LOOKUP(<field1>, <expr>, <field2>
        [, <expC>])

-----------------------------------
Searches a database for the first occurrence of a specified expression.
Return value - Character, Numeric, Logical or Date
-----------------------------------

If an index is available, it is used to find the expression; otherwise,
a LOCATE is performed.

If the expression is found, the record pointer is moved to the record
corresponding to the expression.  The contents of a specified field from
the record is returned.  If no record is found, the null string is
returned and the record pointer is left at the end of the file.  Record
pointers in related files are moved to the related records.

This function is not Rushmore optimizable.

<field1>
        If the search is successful, the field specified in <field1> is
returned.  If the search is unsuccessful, the null string is returned.

<expr>
        The expression to search for is specified by <expr>.  The expression
can be the contents of a field in the database.  If the database is
indexed, LOOKUP() searches the primary index for the expression.

        If you include the name of a compact index tag in the optional
character expression <expC>, the search expression should match the
index expression for the compact index tag.  Including a compact index
tag name lets you search the database on a combination of fields.

<field2>
        If the database does not have an active index, LOOKUP() uses LOCATE to
search the field specified in <field2> for the expression.  If the
database is indexed, LOOKUP() searches the primary index for the
expression.  If you include an compact index tag name in the optional
character expression <expC>, LOOKUP() searches the compact index tag for
the expression.

<expC>
        You can specify an optional compact index tag to use in the search.
The name of the compact index tag is specified in <expC>.  The compact
index tag can be created from a combination of fields from the database,
and the search expression should match the compact index's index
expression.

-----------------------------------

See Also:  FIND, INDEX, LOCATE, SEEK, SEEK()

-----------------------------------

See Also: FIND INDEX LOCATE SEEK SEEK()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson