Код:
static void Job56(Args _args)
{
Dictionary dict = new Dictionary();
DictTable dictTable;
SysDictField dictField;
Map fieldMap;
SysOperationProgress progress = new SysOperationProgress();
int i, j, t;
Description des = 'Поиск задвоенных имен полей';
;
SetPrefix(des);
t = dict.tableCnt();
Progress.setCaption(des);
progress.setTotal(t);
for(i = 1; i <= t; i++)
{
dictTable = new DictTable(dict.tableCnt2Id(i));
SetPrefix(strFmt("%1 %2", dictTable.name(), dictTable.label()));
progress.setText(strFmt("%1 %2 (%3 из %4)", dictTable.name(), dictTable.label(), i, t));
progress.incCount();
fieldMap = new Map(Types::String, Types::String);
for(j = 1; j <= dictTable.fieldCnt(); j++)
{
dictField = new SysDictField(dictTable.id(), dictTable.fieldCnt2Id(j));
if(! fieldMap.exists(dictField.label()) )
fieldMap.insert(dictField.label(), strFmt("(%1 %2)", dictField.name(), dictField.labelLabel()));
else
{
info(strFmt("%1 (%2 %3)", dictField.label(), dictField.name(), dictField.labelLabel()));
info(strFmt("%1 %2", dictField.label(), fieldMap.lookup(dictField.label())));
}
}
}
}