Another thing, you are comparing two different functions with different return values:
- Code: Select all
IndexOf - return Integer, -1 when not found (check delphi documentation)
and
- Code: Select all
ItemsByValue - return item, nil when not found
So obvious, when you access the nil object you will get AV...
Best Regards.