X++:
static void msk_testStruct(Args _args)
{
struct val;
Map map = new map(Types::Integer, Types::Class);
MapEnumerator enum;
int i;
struct setCar(int modelYear, str Carbrand)
{
struct myCar;
;
myCar = new struct ("int ModelYear; str Carbrand");
mycar.value ("ModelYear", modelYear);
mycar.value ("Carbrand", carbrand);
return mycar;
}
;
map.insert(1, setCar(2000, "BMW"));
map.insert(2, setCar(2005, "Mersedes"));
enum = map.getEnumerator();
while (enum.moveNext())
{
i = enum.currentKey();
val = enum.currentValue();
info(strFmt("N = %1, Year = %2, Brand = %3", i, val.value("ModelYear"), val.value("Carbrand")));
}
}