RDD

DbEval()

Evaluate a block for records in a scope

Syntax

Signature
DbEval( bBlock, [bForCondition], [bWhileCondition], [nNextRecords], [nRecord], [lRest] ) --> NIL

Arguments

bBlock

Block evaluated for each selected record. Remaining arguments define the scope.

Return value

NIL.

Description

DbEval() walks records in the current work area and evaluates bBlock for each record accepted by the FOR, WHILE and range arguments.

Notes

The record pointer is restored after evaluation.

Example

DbEval.prg
PROCEDURE Main()

   DbCreate( "eval_demo.dbf", { { "NAME", "C", 12, 0 } } )
   DbUseArea( .T., , "eval_demo.dbf", "People" )
   DbAppend()
   FieldPut( 1, "Anna" )
   DbAppend()
   FieldPut( 1, "Jan" )
   DbCommit()
   QOut( "Names:" )
   DbEval( {|| QOut( FIELD->NAME ) } )
   DbCloseArea()
   FErase( "eval_demo.dbf" )


   RETURN

Output

See also