Click or drag to resize

CoreDb.Eval Method

X#
Evaluate a code block for each record that matches a specified scope and/or condition.

Namespace:  XSharp
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.19
Syntax
 STATIC METHOD Eval(
	uBlock AS ICodeblock,
	uCobFor AS ICodeblock,
	uCobWhile AS ICodeblock,
	uNext AS Object,
	nRecno AS Object,
	lRest AS LOGIC
) AS LOGIC
Request Example View Source

Parameters

uBlock
Type: ICodeblock
The code block to execute for each record that matches the scope and conditions.
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.
uNext
Type: Object
The number of records to process, starting at the current record.
nRecno
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
By default, Eval() operates on the currently selected work area. It will operate on an unselected work area if you specify it as part of an aliased expression. On each iteration, Eval() evaluates the specified code block. All records within the scope or matching the condition are processed until end-of-file is reached. Eval() can be used as a primitive for the construction of commands that process database files. In fact, many of the database processing commands are created using Eval().
See Also