Tclientdataset.Locate being silly

While I am using TMS, Claude assures me the behaviour is in Delphi as well and that it is deliberate and useful. To the latter - I said rubbish.

It seems that

  • on a filtered dataset,
  • with the record being searched for, filtered out
  • Locate finds the record but then gives an exception because the cursor cant be positioned on it

Then why is Locate a function at all? I hate needless exceptions disturbing the code flow.

Now I have to wrap all my locates with a try- except - into the future. YUCK.

It shouldn’t according to the docs, point Claude here

https://docwiki.embarcadero.com/Libraries/Florence/en/Datasnap.DBClient.TCustomClientDataSet.Locate

I feel like I remember this as a TClientDataSet bug from years ago that was fixed quite some time ago too. What Delphi version are you running?

I am running 12, but I think this is in TMS webcore, not in Delphi. I have registered it there as a bug.