Possible improvement for OrderListAdd in XSharp.RDD
Posted: Thu Mar 23, 2023 8:47 am
A collegue of mine has pointed out an issue in OrderListAdd() / ADSIndex.prg:
If the result of ACE.ADSOpenIndex() is ACE.AE_INDEX_ALREADY_OPEN (5065) in line 481 the logic checks all open indices against the desired one. If there is a hit self:Index is set correctly and the surrounding logic could proceed w/o problems.
However since there ist still 5065 in result, SELF:_CheckError(result,EG_OPEN) in line 506 throws an error which leads to confusing protocols. Would it make sense to set result back to AE_SUCCESS in line 491 before exiting the fallback logic?
I have attached a screenshot of our proposal (blue line). Feel free to comment
If the result of ACE.ADSOpenIndex() is ACE.AE_INDEX_ALREADY_OPEN (5065) in line 481 the logic checks all open indices against the desired one. If there is a hit self:Index is set correctly and the surrounding logic could proceed w/o problems.
However since there ist still 5065 in result, SELF:_CheckError(result,EG_OPEN) in line 506 throws an error which leads to confusing protocols. Would it make sense to set result back to AE_SUCCESS in line 491 before exiting the fallback logic?
I have attached a screenshot of our proposal (blue line). Feel free to comment