Предлагаю сразу заполнить каким-нибудь непреметным значением пустые Labels.
За основу взял job от
gl00mie
X++:
#AOT
static void AOTprintUpdateEnumValuesUnlabeled(Args _args)
{
TreeNodeIterator tnIterator;
TreeNode tnEnum,
tnEmunChild;
DictEnum dtEnum;
boolean bEnumIsOk;
str strValueLabel;
int i;
int cnProcessed = 0;
int cnUnlabeled = 0;
int cnEnumsNotOk= 0;
// zan 03.05.2007 -->
int conElmUpd = 3; //Label
str properties,
labelValueNew = '-',
conValue;
container conProperties;
// zan 03.05.2007 <--
;
tnIterator = TreeNode::findNode(#BaseEnumsPath).AOTiterator();
while(true)
{
tnEnum = tnIterator.next();
if(!tnEnum) break;
cnProcessed++;
dtEnum = new DictEnum(tnEnum.applObjectId());
if(!dtEnum)
{
error(strfmt(@"Failed to create DictEnum object for '%1\%2' (objectId %3)!",
#BaseEnumsPath, tnEnum.AOTname(), tnEnum.applObjectId()));
continue;
}
bEnumIsOk = true;
for(i=0; i<dtEnum.values(); i++)
{
strValueLabel = dtEnum.index2Label(i);
if(!strValueLabel)
{
cnUnlabeled++;
bEnumIsOk = false;
warning(strfmt(@"%1::%2 (value %3) has no label!",
dtEnum.name(), dtEnum.index2Symbol(i), dtEnum.index2Value(i)));
// zan 03.05.2007 -->
if(labelValueNew)
{
tnEmunChild = tnEnum.AOTfindChild(dtEnum.index2Symbol(i));
properties = tnEmunChild.AOTgetProperties();
conProperties = str2con(properties,'\n');
conValue = conpeek(conProperties,conElmUpd);
conValue += labelValueNew;
conProperties = conpoke(conProperties, conElmUpd, conValue);
properties = con2str(conProperties,'\n');
tnEmunChild.AOTsetProperties(properties);
tnEmunChild.AOTsave();
tnEnum.AOTsave();
//info(properties);
}
// zan 03.05.2007 <--
}
}
if(!bEnumIsOk)
cnEnumsNotOk++;
}
info(strfmt(@"%1 base enums processed, %2 unlabeled enum values found in %3 enums", cnProcessed, cnUnlabeled, cnEnumsNotOk));
}
// gl00mie, 20070503 <--