Generics are classes, structures, interfaces, and methods with placeholders for the datatypes that they store or use.
A generic collection class can use a datatype parameter as a placeholder for the types of objects that it stores or returns. A generic method can also use its datatype parameter as a type for any of its formal parameters (arguments).
In PowerBuilder .NET, you can consume .NET generic classes and methods that conform to CLS generic rules. However, you cannot define a generic type or override generic methods.
System.Collections.Generic.SortedList<string, integer> teams teams = create System.Collections.Generic.SortedList<string, & +integer> teams["DEV"] = 30 teams["QA"] = 25
MyDll.GenericClass2<MyDll.Class1>.GenericClass2_1<System.String> o1 o1 = CREATE MyDll.GenericClass2<MyDll.Class1>.GenericClass2_1 & +<System.String>
string p1 = "p1", p2 = "p2" MyDll.GenericClass1<MyDll.Class1> o2 o2 = CREATE MyDll.GenericClass1<MyDll.Class1> //Calling a normal function of the .NET generic type //with the Dynamic keyword o2.Dynamic GenericTest11(p1, p2) //Calling a generic function of the .NET generic type //with the Dynamic keyword o2.Dynamic GenericTest12<MyDll.MyClass2>(p1, p2) //Calling a generic function of the .NET generic type //with Dynamic and Post keywords o2.Dynamic POST GenericTest11<MyDll.MyClass2>(p1, p2) //Calling a generic function of the .NET generic type //with Post and Dynamic keywords o2.POST Dynamic GenericTest12<MyDll.MyClass2>(p1, p2)