Possible improvement for OrderListAdd in XSharp.RDD

This forum is meant for questions and discussions about the X# language and tools
Post Reply
stefan.ungemach
Posts: 71
Joined: Thu Jul 15, 2021 10:46 am
Location: Germany

Possible improvement for OrderListAdd in XSharp.RDD

Post by stefan.ungemach »

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 :)
RDDcode.png
RDDcode.png (231.53 KiB) Viewed 192 times
User avatar
robert
Posts: 4225
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Possible improvement for OrderListAdd in XSharp.RDD

Post by robert »

Stefan,

Good catch!

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Post Reply