Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Closing ALL hidden modules...
Topic Summary:
Created On: 3-Aug-2005 17:22
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
Answer This question was answered by Chris Jones, on Thursday, August 4, 2005 4:15 PM

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!
 3-Aug-2005 17:22
User is offline View Users Profile Print this message


Chris Jones

Posts: 177
Joined: 1-Jul-2005

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
Report this to a Moderator Report this to a Moderator
 3-Aug-2005 18:31
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

Prossible solution is to create an array or skip list of non-visible modules then iterate thru the list closing the modules.

Report this to a Moderator Report this to a Moderator
 3-Aug-2005 18:37
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

I looked again at you if statement and you got bitten by the double nots.

Change && to ||
Report this to a Moderator Report this to a Moderator
 3-Aug-2005 19:24
User is offline View Users Profile Print this message


Chris Jones

Posts: 177
Joined: 1-Jul-2005

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...
Report this to a Moderator Report this to a Moderator
 4-Aug-2005 08:25
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

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
Report this to a Moderator Report this to a Moderator
 4-Aug-2005 16:15
User is offline View Users Profile Print this message


Chris Jones

Posts: 177
Joined: 1-Jul-2005

Answer 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!
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.