I have a TList which I populate dynamically, from the database, it contains an ID and Name.
What I need to know is how to search for a certain Name in that TList by providing an ID without using for loop.
I have a TList which I populate dynamically, from the database, it contains an ID and Name.
What I need to know is how to search for a certain Name in that TList by providing an ID without using for loop.
Copyright © 2021 Jogjafile Inc.
Unfortunately, that is exactly what you must use. A
TListcontaining pointers only knows how to search for pointers, nothing else. To do what you are wanting, you must loop through the list dereferencing the pointers manually in order to compare their field values.For example: