Click or drag to resize

CoreDb.Locate Method

X#
Search for the first record that matches a specified condition and scope.

Namespace:  XSharp
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.21
Syntax
 STATIC METHOD Locate(
	uCobFor AS ICodeblock,
	uCobWhile AS ICodeblock,
	nNext AS LONG,
	uRecId AS Object,
	lRest AS LOGIC
) AS LOGIC
Request Example View Source

Parameters

uCobFor
Type: ICodeblock
A code block that defines a condition that each record within the scope must meet in order to be processed.
uCobWhile
Type: ICodeblock
A code block that defines another condition that each record must meet in order to be processed. As soon as a record is encountered that causes the condition to fail, the operation terminates.
If no scope is specified, cbWhileCondition changes the default scope to lRest.
You define the scope using one of these three, mutually exclusive arguments.
The default is all records.
nNext
Type: Long
The number of records to process, starting with the current record.
uRecId
Type: Object
The number of the record to process.
lRest
Type: Logic
TRUE processes only records from the current record to end-of-file. FALSE processes all records.

Return Value

Type: Logic
TRUE if successful; otherwise, FALSE.
Remarks
This function is like DBLocate() but strongly typed.

This function, however, does not call the error handler and will therefore not produce a runtime error message or create an error object if it fails.
Therefore it is important to check the return value to determine if the function succeeded.

The LastRddError property in the runtimestate will contain needed information about any error that occurs.
See Also