IndexSeek Function | |
-- todo --
Without moving the record pointer, searches an indexed table for the first occurrence of a record whose index key matches a specified expression.
Namespace:
XSharp.VFP
Assembly:
XSharp.VFP (in XSharp.VFP.dll) Version: 2.19
Syntax FUNCTION IndexSeek(
eExpression,
lMovePointer,
uArea,
uIndex
) AS LOGIC CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public static bool IndexSeek(
Usual eExpression = default,
Usual lMovePointer = default,
Usual uArea = default,
Usual uIndex = default
)
Request Example
View SourceParameters
- eExpression (Optional)
- Type: Usual
Specifies the index key expression for which you want IndexSeek( ) to search.
- lMovePointer (Optional)
- Type: Usual
Specifies if the record pointer is moved to the matching record. If lMovePointer is true (.T.) and a matching record exists,
the record pointer is moved to the matching record. If lMovePointer is true (.T.) and a matching record doesn't exist,
the record pointer isn't moved. If lMovePointer is false (.F.) or is omitted, the record pointer isn't moved even if a matching record exists.
- uArea (Optional)
- Type: Usual
Specifies the work area number of the table that is searched for the index key.
Or
Specifies the alias of the table that is searched. If you omit uArea, the table in the currently selected work area is searched.
- uIndex (Optional)
- Type: Usual
Return Value
Type:
Logic
Logical
Remarks IndexSeek( ) returns true (.T.) if a match is found; otherwise false (.F.) is returned.
You can use IndexSeek( ) only with a table with an index order set, and you can search only for an index key.
The match must be exact unless Set EXACT is set to OFF.
IndexSeek( ) provides a fast way to search for records without moving the record pointer.
Because the record pointer isn't moved, rules and triggers aren't executed. If IndexSeek( ) returns true
(.T.) indicating that a matching record is found, you can execute IndexSeek( ) again with the second parameter lMovePointer set to true
(.T.) to move to the matching record.
IndexSeek( ) returns false (.F.) when you are attempting to find a value in the most recently created record
(created with Insert Into or Append Blank) until the record pointer is moved. You can execute a GO BOTTOM command to
cause IndexSeek( ) to find the most recently created record.
See Also