I'm using the following code to count the number of objects that don't have a link. It seems to work, and the print instruction prints "Test cases" but when I replace "*" with "Test cases", the for statement doesn't find any matches. What gives? Secondly the DOORS 8.2 DXL Reference Manual states that srcModName uses the link module name; however, it seems to take the source module name instead. Is this an error in the manual? Lastly, is there a better way to do this? Thanks, Ken.
for o in m do {
count++
count_notests++ // assume object doesn't have an in-link
increment = false
for srcModName in o <- "*" do {
increment = true
print srcModName "\n"
}
if (increment) count_notests-- //object does have an in-link
}
}
mcnairk - Mon Sep 19 11:52:06 EDT 2011 |
Re: Weird behaviour of "for srcModName in o"
>>1 The srcModName loop is useless as it returns the base name of source module, and if that module is in some other folder you may not be able to find it. Also, it is the SOURCE module name.
ModName_ mmSource
Module mLMod
LinkRef lr
for lr in o<" do
{ mnSource = source(lr)
mLMod = module(lr)
print "\thas link from: " (fullName(mnSource)) "\t in LMod " (fullName(mLMod)) "\n"
}
|
Re: Weird behaviour of "for srcModName in o" llandale - Mon Sep 19 16:24:35 EDT 2011
>>1 The srcModName loop is useless as it returns the base name of source module, and if that module is in some other folder you may not be able to find it. Also, it is the SOURCE module name.
ModName_ mmSource
Module mLMod
LinkRef lr
for lr in o<" do
{ mnSource = source(lr)
mLMod = module(lr)
print "\thas link from: " (fullName(mnSource)) "\t in LMod " (fullName(mLMod)) "\n"
}
Works dandy after fixing a couple of typos:
ModName_ mnSource
Module mLMod
LinkRef lr
for lr in o <- "*" do
{ mnSource = source(lr)
mLMod = module(lr)
print "\thas link from: " (fullName(mnSource)) "\t in mLMod " (fullName(mLMod)) "\n"
}
|
Re: Weird behaviour of "for srcModName in o" mcnairk - Tue Sep 20 10:25:11 EDT 2011
Works dandy after fixing a couple of typos:
ModName_ mnSource
Module mLMod
LinkRef lr
for lr in o <- "*" do
{ mnSource = source(lr)
mLMod = module(lr)
print "\thas link from: " (fullName(mnSource)) "\t in mLMod " (fullName(mLMod)) "\n"
}
The code to 'read' a module that is already open doesn't take much time, for me 100,000 extra 'read' commands for a very large module took only 4 seconds. |