I'm counting the number of unarchived formal modules by opening each module to test a module attribute (see code below), but this takes forever, especially since this count is only used to set up the progress bar, before I even start doing the real work. Is there a way to access a module attribute without opening the module?
Item i
current = folder "/MyProject/MyFolder"
//Initialise progress bar
int nos = 0
int maxnos = 0
for i in current do
{
if (type(i) == "Formal") // Ignore sub-folders and link modules,
{
Module m = read(fullName(i), false) //Too slow!!!
string IsArchived = m."Archived"
if (IsArchived == "False")// Ignore archived modules
{
maxnos++ //Count number of modules to be reviewed
}
}
}
progressStart(dbExplorer, "My Report", "Initializing...", maxnos)
mcnairk - Thu Jul 19 13:16:05 EDT 2012 |
Re: Accessing module attributes without opening the module
Have a look at "Module Properties" in the DXL help:
ModuleProperties mp
ModuleVersion mv
string mname = "/My Project/Module1"
string s
mv = moduleVersion(module mname)
string err1 = getProperties (mv, mp)
if (!null err1){
print err1 "\n"
}
AttrType at
print "Module Types: \n"
for at in mp do {
print "\t - " (at.name) "\n"
}
print "\nModule Attributes: \n"
for s in mp do {
print "\t - " s " : "
val = mp.s ""
print val "\n"
}
|
Re: Accessing module attributes without opening the module Peter_Albert - Fri Jul 20 03:25:46 EDT 2012
Have a look at "Module Properties" in the DXL help:
ModuleProperties mp
ModuleVersion mv
string mname = "/My Project/Module1"
string s
mv = moduleVersion(module mname)
string err1 = getProperties (mv, mp)
if (!null err1){
print err1 "\n"
}
AttrType at
print "Module Types: \n"
for at in mp do {
print "\t - " (at.name) "\n"
}
print "\nModule Attributes: \n"
for s in mp do {
print "\t - " s " : "
val = mp.s ""
print val "\n"
}
Ken. |
Re: Accessing module attributes without opening the module Peter_Albert - Fri Jul 20 03:25:46 EDT 2012
Have a look at "Module Properties" in the DXL help:
ModuleProperties mp
ModuleVersion mv
string mname = "/My Project/Module1"
string s
mv = moduleVersion(module mname)
string err1 = getProperties (mv, mp)
if (!null err1){
print err1 "\n"
}
AttrType at
print "Module Types: \n"
for at in mp do {
print "\t - " (at.name) "\n"
}
print "\nModule Attributes: \n"
for s in mp do {
print "\t - " s " : "
val = mp.s ""
print val "\n"
}
|
Re: Accessing module attributes without opening the module llandale - Fri Jul 20 10:22:35 EDT 2012 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Accessing module attributes without opening the module Mathias Mamsch - Thu Aug 02 04:18:19 EDT 2012 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS THX, Ken. |
Re: Accessing module attributes without opening the module Mathias Mamsch - Thu Aug 02 04:18:19 EDT 2012 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS I see getting the Module Properties via right-click works fine, "Attr-DXL" is displayed for its value. -Louie |