List object that extends a Collection
List exposes the standard functionality of a Collection object as well as providing additional useful functionality that avoids boilerplate.
- Push and Pop in Stack or Queue mode.
- IndexOf method to search list.
- Reference objects by negative index gets from end.
- Slice list by range of indices.
- Filter list by predicate.
- Sort list.
Download the List.cls file and add it to your project.
Note: This class depends on a reference to OLE Automation, however, this is referenced by default for new workbooks.
Released under MIT by Sam Vanderslink. Free to modify and reuse.
Read the docs for usage and examples.
Pass: TestList_ItemPositiveIndexReturnsItem
Pass: TestList_ItemNegativeIndexReturnsItem
Pass: TestList_ItemsAsObjectsReturned
Pass: TestList_InsertInsertsAtZero
Pass: TestList_InsertInsertsMid
Pass: TestList_RemoveRemovesItem
Pass: TestList_IndexOfReturnsValueIndex
Pass: TestList_IndexOfDoesntFindValueIndex
Pass: TestList_IndexOfDoesntFindValueNoItems
Pass: TestList_IndexOfReturnsObjectIndex
Pass: TestList_PushAddsItem
Pass: TestList_PopGetsAndRemovesFromQueue
Pass: TestList_PopGetsAndRemovesFromStack
Pass: TestList_ItemGetsItemsSlice
Pass: TestList_FilterFiltersStrings
Pass: TestList_FilterFiltersNumbers
Pass: TestList_SortListSortsStrings
Pass: TestList_SortListSortsNumbers
Pass: TestList_ForEachLoop
-------------------------------------------
Passed: 19 (100.00%)
Failed: 0 (0.00%)
-------------------------------------------