Reputation: 139
Is there a way to get the attributes of a module without reading it? I need to get that information for about 100 modules and it takes over 10 minutes if I have to read each module
I don't need to actually get the objects just the attributes available in the module
Upvotes: 0
Views: 407
Reputation: 2346
ModuleProperties should be faster. Try sth like this:
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
}
}
If you are also interested in the existence of attribute definitions for Objects, this might help
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
}
}
Upvotes: 1