Hi Przemek, I don't think you understand what I mean...
In Clipper, if you attempt to update a record when at EOF (ie. by mistake), it does NOT cause a runtime error (which is bad!). Harbour, on the other hand, does generate a runtime error (which is good!).
However, what I am saying is that, the error message that Harbour generates now (ie. "Variable does not exist") is misleading. I am suggesting that is be re-worded to "Attempt to update record while at EOF".
Does that make sense? Regards, Randy. At 05:07 PM 7/7/2008, you wrote:
On Mon, 07 Jul 2008, Randy Portnoff wrote: Hi Randy, > When at EOF() and attempt to replace a field, get runtime error as > "Variable does not exist" - This is better than Clipper which does > not throw an error at all, but I think a more meaningful error > message should be used like: "Attempt to update record while at EOF". I can imagine valid Clipper code which uses this behavior intentionally, f.e. to drop new record data by simple disabling APPEND BLANK instruction without interrupting the execution context so such modification will break it. If you need such functionality then you can make it yourself very easy using USRRDD library and overloading PUTVALUE method, f.e. see code below. best regards, Przemek #include "rddsys.ch" #include "hbusrrdd.ch" ANNOUNCE MYRDD REQUEST DBFCDX STATIC FUNCTION MYRDD_GenErorr( nWA, nField, xValue ) LOCAL oError oError := ErrorNew() oError:GenCode := EG_UNSUPPORTED oError:SubCode := 9999 oError:Description := "Attempt to update record while at EOF" oError:CanDefault := .T. UR_SUPER_ERROR( nWA, oError ) RETURN FAILURE STATIC FUNCTION MYRDD_PUTVALUE( nWA, nField, xValue ) IF EOF() RETURN MYRDD_GenErorr() ENDIF RETURN UR_SUPER_LOCK( nWA, nField, xValue ) FUNCTION MYRDD_GETFUNCTABLE( pFuncCount, pFuncTable, pSuperTable, nRddID ) LOCAL cSuperRDD := "DBFCDX" /* We are inheriting from DBFCDX */ LOCAL aMethods[ UR_METHODCOUNT ] aMethods[ UR_PUTVALUE] := ( @MYRDD_PUTVALUE() ) RETURN USRRDD_GETFUNCTABLE( pFuncCount, pFuncTable, pSuperTable, nRddID, ; cSuperRDD, aMethods ) INIT PROC MYRDD_INIT() rddRegister( "MYRDD", RDT_FULL ) RETURN _______________________________________________ Harbour mailing list Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour
_______________________________________________ Harbour mailing list Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour