RDD

FieldBlock()

Return a set-get block for a field

Syntax

Signature
FieldBlock( cFieldName ) --> bFieldBlock

Arguments

cFieldName

Field name.

Return value

A block that gets the field value with no argument and assigns it with one argument.

Description

FieldBlock() creates a reusable block for reading or writing a field in the current work area.

Notes

The field must exist in the current work area when the block is used.

Example

FieldBlock.prg
PROCEDURE Main()

   LOCAL bName

   DbUseArea( .T., , "people.dbf", "People" )
   bName := FieldBlock( "NAME" )
   QOut( "Name: " + RTrim( Eval( bName ) ) )
   DbCloseArea()

RETURN

Output

See also