TGStringList.ForEach(TForEachObjectMethod,TForEachFilterMethod,LongInt) Method |
Scroll Prev Top Next More |
The ForEach method will iterate over the string list calling the Proc function for every item that passes the FilterFunction (or all items if the FilterFunction is unassigned). The ForEach method allows class methods to be passed instead of regular functions and procedures.
Note |
---|
The order that the items are processed is not guaranteed, just that every item will be evaluated. In fact, this method goes through the items in reverse order so that the Proc method could delete items without affecting items not yet visited. This may change. |
Namespace: Structures
Delphi |
public |
Parameters
Proc
Type: TForEachObjectMethod
FilterFunction
Type: TForEachFilterMethod
ATag
Type: LongInt
The following example iterates through the list and will delete all items that objects that equal a specified object (passed using the tag):
|