Hi everyone,
I just found out that OpenEdge does provide collections. https://documentation.progress.com/output/oehttpclient/oe116/index.html
Currnently I have succeeded in adding items to a map / collection. (That was the easy part). Now I am wondering on how to get the data out of the collection.
CLASS Order:
DEFINE PUBLIC PROPERTY OrderNo AS INT NO-UNDO
GET.
SET.
USING OpenEdge.Core.Collections.Map.
USING Order.
DEF VAR oOrder as Order NO-UNDO.
DEF VAR oOrders as Map NO-UNDO.
oOrders = new Map().
oOrder = new Order().
oOrder:OrderNo = 123456.
oOrders.Put(123456, oOrder).
// Now iterate over the collection. In C# this would be something like:
foreach (Order order in oOrders) {
System.Out.Println(order.OrderNo);
}
How van this be done in ABL for Collections and Maps?
Thanks for your fast response, Peter
What we really need is generics so we can have typed collections.
Non-generic collections in the .NET framework are long deprecated (stackoverflow.com/.../are-non-generic-collections-in-net-obsolete, docs.microsoft.com/.../when-to-use-generic-collections).
While I appreciate the effort Peter has put into this, Progress should really start working on generics...
Meanwhile you can get somewhere near generic functionality by using include files but that's really just an ugly workaround...
I completely agree Lieven
+1 from me too, Peter and Lieven