if Not Sorted then Raise EListError.Create(SErrFindNeedsSortedList);
Read the text of the exception AND the embarcadero URL you quote.FIND ONLY WORKS ON SORTED LISTS, so addCode: Pascal [Select][+][-]mylist.sorted:=true;before adding elements.The only difference is that Delphi fails silently, and FPC with an exception. Deliberately.
No, the difference is that delphi does not fail and finds the item required and fpc fails with an exception.
I need to use Find so that the stringlist can be searched using the binary search method. How do I do this in Lazarus?
Quote from: JD on August 18, 2017, 05:42:00 pmI need to use Find so that the stringlist can be searched using the binary search method. How do I do this in Lazarus?whatever you do, do not add a widestring manager
Quote from: taazz on August 18, 2017, 06:08:13 pmNo, the difference is that delphi does not fail and finds the item required and fpc fails with an exception.Newer versions might contain fallback to indexof, iirc the older ones didn't. But then it isn't binary search, and it isn't documented