B
B. Chernick
I'm studying for a cert and hacking some code. I have a generic List(of T)
declared which contains a number of instances of a class. What I would like
to do is setup a search predicate (?) on Find that would return a class
instance with a unique property value. (But I'm not clear on the concept.)
What I have so far is a function within the the class defined as: Private
Function test(ByVal x As Class1) As Boolean. The compiler will then accept
Class1Instance = List1.Find(AddressOf test).
I suppose I could define a variable outside the test function but that seems
sloppy. How do you set up a delegate so that you can pass a search parameter
directly from the Find itself? (Can you?)
declared which contains a number of instances of a class. What I would like
to do is setup a search predicate (?) on Find that would return a class
instance with a unique property value. (But I'm not clear on the concept.)
What I have so far is a function within the the class defined as: Private
Function test(ByVal x As Class1) As Boolean. The compiler will then accept
Class1Instance = List1.Find(AddressOf test).
I suppose I could define a variable outside the test function but that seems
sloppy. How do you set up a delegate so that you can pass a search parameter
directly from the Find itself? (Can you?)