问题描述
有没有办法在不读取模块的情况下获取它的属性? 我需要获取大约 100 个模块的信息,如果我必须阅读每个模块需要 10 多分钟
解决方法
ModuleProperties 应该更快。试试这样:
Item i = null
ModuleProperties mp = null
string sModuleAttribute = ""
string sError = ""
for i in project "/<myproject>" do {
if (type i == "Formal") {
sError = getProperties (moduleVersion module fullName i,mp)
if (null sError) {
for sModuleAttribute in mp do {
print fullName i "\t" sModuleAttribute "\t" mp.sModuleAttribute "\n"
}
} else {print sError "\n"}
delete mp
}
}
如果您也对对象的属性定义感兴趣,这可能会有所帮助
Item i = null
ModuleProperties mp = null
AttrDef ad = null
string sError = ""
for i in folder "/<myproject>" do {
if (type i == "Formal") {
sError = getProperties (moduleVersion module fullName i,mp)
if (null sError) {
for ad in mp do {
print fullName i "\t" ad.name "\t" ad.typeName "\t" ad.object "\t" ad.module "\n"
}
} else {print sError}
delete mp
}
}