Я бы предложил что-то типа такого
PHP код:
static void Job21(Args _args)
{
inventtable inventtable;
Map map = new Map(Types::Record, Types::Integer);
MapIterator mi;
int i;
int epb;
;
i = 1;
while select inventtable
{
map.insert(inventtable, 10);
i++;
if (i > 30) break;
}
next inventtable;
epb = infolog.errorsPerBatch();
infolog.errorsPerBatch(-1);
try
{
i = map.lookup(inventtable);
map.insert(inventtable, 100 + i);
}
catch (Exception::Error)
{
map.insert(inventtable, 100);
}
try
{
i = map.lookup(inventtable);
map.insert(inventtable, 20 + i);
}
catch (Exception::Error)
{
map.insert(inventtable, 100);
}
infolog.errorsPerBatch(epb);
mi = new MapIterator(map);
while (mi.more())
{
inventtable = mi.key();
i = mi.value();
info(inventtable.itemName + ":" + int2str(i));
mi.next();
}
}