diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a1426b5757..85d1aa2560 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,13 @@ The license applies to all entries newer than 2009-04-28. */ +2010-12-23 22:40 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/src/rtl/fieldbl.prg + ! fixed FieldBLock() and FieldWBLock() to be CA-Cl*pper compatible + (they should return NIL for field names which are not valid + identifiers and generate RTE during evaluation if field does + not exist) + 2010-12-23 13:45 UTC+0200 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt) * harbour/contrib/rddads/ads1.c + added DBFIELDINFO( DBS_ISNULL, ) support diff --git a/harbour/src/rtl/fieldbl.prg b/harbour/src/rtl/fieldbl.prg index 5d9805bffd..13c2698dc2 100644 --- a/harbour/src/rtl/fieldbl.prg +++ b/harbour/src/rtl/fieldbl.prg @@ -53,19 +53,24 @@ #include "common.ch" FUNCTION FIELDBLOCK( cFieldName ) + LOCAL bField - IF ISCHARACTER( cFieldName ) - RETURN {| x | iif( x == NIL, FieldGet( FieldPos( cFieldName ) ),; - FieldPut( FieldPos( cFieldName ), x ) ) } - ENDIF + BEGIN SEQUENCE WITH {|| BREAK() } + bField := &( "{|x| IIF( x == NIL, FIELD->" + cFieldName + ", " + ; + "FIELD->" + cFieldName + " := x ) }" ) + END SEQUENCE - RETURN NIL + RETURN bField FUNCTION FIELDWBLOCK( cFieldName, nWorkArea ) + LOCAL bField, cAlias - IF ISCHARACTER( cFieldName ) .AND. ISNUMBER( nWorkArea ) - RETURN {| x | iif( x == NIL, ( nWorkArea )->( FieldGet( FieldPos( cFieldName ) ) ),; - ( nWorkArea )->( FieldPut( FieldPos( cFieldName ), x ) ) ) } - ENDIF + BEGIN SEQUENCE WITH {|| BREAK() } + IF Int( nWorkArea ) != 0 + cAlias := "(" + HB_NToS( Int( nWorkArea ) ) + ")->" + bField := &( "{|x| IIF( x == NIL, " + cAlias + cFieldName + ", " + ; + + cAlias + cFieldName + " := x ) }" ) + ENDIF + END SEQUENCE - RETURN NIL + RETURN bField