Dynamic lists without the drama.
OpenEdge arrays are powerful—but they come with baggage. Manual resizing, index juggling, and boilerplate loops can turn simple tasks into tedious chores. That’s where ListUtil.cls steps in: a utility class designed to make list handling intuitive, flexible, and modern.
What It Actually Solves
➕ Dynamic Element Management: Add or remove items from a list without worrying about array bounds or resizing logic.
🔍 Searching and Filtering: Find elements or filter lists based on custom conditions—no nested loops required.
🔃 Sorting Made Simple: Sort lists using default behavior or custom rules, with minimal setup.
♻️ Reusability Across Contexts: Pass lists between methods or sessions without losing structure or clarity.
Use Cases That Shine
- Collecting user selections from a UI
- Storing validation errors dynamically
- Filtering buffer data by status, category, or other attributes
- Building reusable list-based workflows for inventory, reporting, or dashboard
e.g.
class class Tests.ListUtilUnitTest:
@Test.
method public void TestAddElementCharacterListDedupe():
define variable cList as character no-undo.
define variable cElement as character no-undo.
cElement = "addElement".
cList = ListUtil:AddElement(cList, cElement).
Assert:Equals("addElement", cList).
cList = ListUtil:AddElement(cList, cElement, true).
Assert:Equals("addElement", cList).
cList = ListUtil:AddElement(cList, cElement, false).
Assert:Equals("addElement,addElement", cList).
end method.
end class.
Why It Matters
- Rapid prototyping: Build and test logic faster without reinventing array mechanics.
- Cleaner codebase: Intuitive methods mean fewer comments, less confusion, and easier onboarding.
- Reusable logic: Abstracted list operations work across modules, making your code DRY and maintainable.
Final Thought
Lists should be flexible. With ListUtil.cls, they finally are. Whether you’re managing user input, building dynamic datasets, or streamlining internal workflows, this class helps you write expressive, efficient, and future-proof code.
Got a list-handling challenge you’d love to see solved? Submit an idea or issue on GitHub—OE Essentials is built with your feedback in mind.
Author: Ioana Trasca, Office Manager & Communications Officer
People-oriented person passionate about writing, reading, traveling and a forever animal lover.