A while back I reported a possible problem with the cSelect object. I had since decided to abandon using it - it was convenient, but I was getting unexplainable behavior that would go away when I just uses two lines of code instead of the one that cSelect offers (i.e. lnArea=select()/select(lnArea)).
I have now come up against the problem in a framework class. Specifically, when the application object instantiates, it runs the addchildren method. The last method called in that calling chain is cDatabaseMgr.MetaData.SelectDefaultDatabaseRecord(). That method has compilation directives which instruct VFP to use the NewObj() function instead of CreateObj() to create cSelect, depending on the version of VFP.
All of a sudden, I am getting bugs when that particular method runs. The cSelect method does not instantiate. In fact, the init method does not even run. I have placed debugouts in the cSelect's init method which shows the callstack for every single instantiation, and not once in the output file is there a reference to the SelectDefaultDatabaseRecord() method.
The problem disappears if CreateObj() is called instead of newobj. In otherwords, if I remove the compilation directive (or whatever it's called) from:
#IF VFP_VERSION >= 6
loSelect = NEWOBJ('CSelect', 'CUtils', '', 'MetaDBC')
#IF .f.
#ELSE
loSelect = CREATEOBJ('CSelect', 'MetaDBC')
#ENDIF