OrderKeyCount failing?
Posted: Mon Nov 06, 2017 12:05 pm
What could be wrong in these 4 lines of code?
uRet1:=SELF:oOwner:Server:OrderScope(TOPSCOPE, "X")
// Note: uRet1 and uRet2 are nil, but if I enter the very same line in debugger I get the correct value...
uRet2:=SELF:oOwner:Server:OrderScope(BOTTOMSCOPE, "X")
SELF:oOwner:Server:GoTop() SELF:oOwner:nNowInFilter:=SELF:oOwner:Server:OrderKeyCount() // ->does not return 1 sometimes
In postinit, I set SELF:oOwner:=uExtra and uExtra is the dbf used in the calling window (an invoice window). When I set the orderscope to "X" (in this message; in reality the actual = an existing invoice number) the orderscope works (we can see that the calling window only contains 1 invoice if e.g. a tabele view is opened) but at the same time OrderKeyCOunt sometimes returns all records of the database. Most of the times both the scope itself and the value to nNowInFilter work fine. I can not see what causes it not to work sometimes and why.
Dick
uRet1:=SELF:oOwner:Server:OrderScope(TOPSCOPE, "X")
// Note: uRet1 and uRet2 are nil, but if I enter the very same line in debugger I get the correct value...
uRet2:=SELF:oOwner:Server:OrderScope(BOTTOMSCOPE, "X")
SELF:oOwner:Server:GoTop() SELF:oOwner:nNowInFilter:=SELF:oOwner:Server:OrderKeyCount() // ->does not return 1 sometimes
In postinit, I set SELF:oOwner:=uExtra and uExtra is the dbf used in the calling window (an invoice window). When I set the orderscope to "X" (in this message; in reality the actual = an existing invoice number) the orderscope works (we can see that the calling window only contains 1 invoice if e.g. a tabele view is opened) but at the same time OrderKeyCOunt sometimes returns all records of the database. Most of the times both the scope itself and the value to nNowInFilter work fine. I can not see what causes it not to work sometimes and why.
Dick