Hi,
The Google Groups software sent a moderation alert message regarding a
post by Victor Casajuana Mas, but when I logged in to release it, it was
no longer there. Based on the content of the alert message I thought
Victor's bug report looked legitimate, so I played with his test code
and came up with a version that maybe shows a little more clearly what
happens.
The starting point was that Victor created a class with no instance
variables to begin with, and then he added a couple of variables with
__objAddData().
The name of one of the instance variables was identical to the name of
the class where he tried to insert it. This kind of naming scheme works
just fine if the variable is declared in the class from the beginning.
But it fails silently if the variable is instead added to an already
instantiated class with __objAddData(). The following code snipped shows
the failure. I doubt that this behavior is intentional, but if it is
supposed not to work, shouldn't there be an RTE instead of a silent failure?
Regards,
Klas
//-------------------------------------
#include '
hbclass.ch'
procedure Main()
local oTest := Test1():New()
__objAddData( oTest, "Test1" )
__objAddData( oTest, "Test2" )
? " Test1", __objHasMsg( oTest, "Test1" ) // .T.
? "_Test1", __objHasMsg( oTest, "_Test1" ) // .F. This seems suspicious
? " Test2", __objHasMsg( oTest, "Test2" ) // .T.
? "_Test2", __objHasMsg( oTest, "_Test2" ) // .T.
return
CREATE CLASS Test1
EXPORTED:
METHOD New() CONSTRUCTOR
ENDCLASS
METHOD New() Class Test1
return self
//-------------------------------------