Use the list operation activity to control list-related tasks.
Uses System.Generics.Collections.TList
Activity properties
begin var GreaterStrings: ICodolexList<string>; GreaterStrings := StringList.Filter( function(Value: string): Boolean begin Result := Value.Length > 10; end ); end; |
Resulting Code
The list operation supports the following actions:
•Count
•Filter
•First
•Last
•Max
•Min
•Sum
Count
Counts the amount of items in a list.
Filter
Filter also needs an Predicate expression to filter on. Value is the collection element variable to be used in the expression.
First
Returns the first object in the collection.
Last
Returns the last object in the collections.
Max
Returns the object with the max value of a given expression.
The 'Left' and 'Right' objects are to be used in the expression.
Min
Returns the object with the min value of a given expression.
The 'Left' and 'Right' objects are to be used in the expression.
Sum
Can only be used on a list with number types, returns the sum of all numbers in the list.
Sort
Changes the list to a certain order. It possible to select the attribute of an entity, or use a left and right comparison.