不打开模块获取属性
Getting attributes without opening the module
有没有办法在不读取模块的情况下获取模块的属性?
我需要获取大约 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
}
}
有没有办法在不读取模块的情况下获取模块的属性? 我需要获取大约 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
}
}