![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Closing ALL hidden modules... Topic Summary: Created On: 3-Aug-2005 17:22 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: Ah, you're right, Tony. I do seem to remember that's a bad idea now. I had tried to assign the module to an intermediate variable too but that's pretty much the same thing. Thanks for the help! | |
![]() |
|
I'm looking for a way to close all the modules that are currently open but not displayed. I've tried the straightforward way:
Module m for m in database do { if ((!isVisible(m)) && (type(m) != "Link")) { close(m) } } However, this doesn't work. It will close one module each time I run it. The for m in database... loop works fine; I can get a listing of every open module by replacing the close statement with a print. But with the close statement in there the loop seems to halt after only one. The only thing that I can think of is that close does something weird with current Module. Has anybody seen this, or done something similar? Thanks, Chris |
|
![]() |
|
![]() |
|
Prossible solution is to create an array or skip list of non-visible modules then iterate thru the list closing the modules. |
|
![]() |
|
![]() |
|
I looked again at you if statement and you got bitten by the double nots.
Change && to || |
|
![]() |
|
![]() |
|
Thanks Ron--I had a similar idea, I count the number of open modules that I want to close (with the for loop) then do another loop that many times (see attached). And, the if statement is correct--I want to close non-visible formal modules. The code attached does the job but it seems ridiculous to do it this way...
|
|
![]() |
|
![]() |
|
Chris, your original script does not work because you are changing the loop control variable (the module) from within the loop. This is never a good idea.
As Ron suggests, I recommend that you always use a skip list for doing stuff like this. The attached does the job. ------------------------- Tony Goodman http://www.smartdxl.com |
|
![]() |
|
![]() |
|
Ah, you're right, Tony. I do seem to remember that's a bad idea now. I had tried to assign the module to an intermediate variable too but that's pretty much the same thing.
Thanks for the help! |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Closing ALL hidden modules...
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.