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: Skip List weird
Topic Summary:
Created On: 22-Jan-2004 17:31
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 Srinivas Dasari, on Friday, January 23, 2004 8:42 PM

Answer:
Thanks Roger, I made changes and its working. What's really surprising is that the earlier code works after I run other programs and then re-run this without closing out the session. May be some of my other programs have a storage similar to this logic and the module information is getting stored internally for DOORS to use it at a later stage.
 22-Jan-2004 17:31
User is offline View Users Profile Print this message


Srinivas Dasari

Posts: 24
Joined: 13-Dec-2003

My code has a skip list that parses and stores the fullNames of all the modules in a project at the very beginning of the code execution. Somewhere else in the code one of the functions returns the module name of the current module under process. I am using the Skip list to make some decisions, using if statement.

if (find(MySkiplist, returned_module_name)) {
logic 1
}
else {
logic 2
}

The first time I run the script, the if statement doesn't seem to work properly but if I run it again the code works alright.. Once I restart DOORS session, the same scenario is seen. The problem might be that the skip list is not getting populated "in-time" so that it can be used by the if statement. DOORS does not generate any errors whatsoever and the code compiles and executes well. I inserted a print loop for the skip list and it does populate the list with the names but don't know when.

How can I get rid of this problem?
Report this to a Moderator Report this to a Moderator
 22-Jan-2004 19:44
User is offline View Users Profile Print this message


Dennis Lockshine

Posts: 113
Joined: 7-Apr-2003

When you declare the creation of the skip list, are you specifying Skip MySkipList = createString?

The find syntax you are using relies on having a string value for the key, which must be declared when the skip list is created.
Report this to a Moderator Report this to a Moderator
 22-Jan-2004 21:06
User is offline View Users Profile Print this message


Srinivas Dasari

Posts: 24
Joined: 13-Dec-2003

yes the declaration I am using is;

Skip MySkipList = createString
Report this to a Moderator Report this to a Moderator
 23-Jan-2004 17:37
User is offline View Users Profile Print this message


Srinivas Dasari

Posts: 24
Joined: 13-Dec-2003

After your insight I tried to see what the skip list is doing and below is the snippet.

The code below stores the module names in testing project in a skip list and prints them.

I ran this first time I entered the DOORS session and all I got was "-------------". Repeated runs did not provide the result, which is the module names. But after successfully running other programs, I ran this again and it did print me the module names.

// Testing the Skip list weird

Project projRef = project "/testing"

Skip MyStorage = createString
string mName
Module m

for m in projRef do {
mName = fullName(m)
put(MyStorage, mName, mName)
}

for mName in MyStorage do {
print mName "\n"
}
print "--------------------------------------" "\n"

delete MyStorage
Report this to a Moderator Report this to a Moderator
 23-Jan-2004 20:42
User is offline View Users Profile Print this message


Srinivas Dasari

Posts: 24
Joined: 13-Dec-2003

Answer Answer
Thanks Roger, I made changes and its working. What's really surprising is that the earlier code works after I run other programs and then re-run this without closing out the session. May be some of my other programs have a storage similar to this logic and the module information is getting stored internally for DOORS to use it at a later stage.
Report this to a Moderator Report this to a Moderator
 23-Jan-2004 22:24
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

To find all the modules in a project, use:
Item itm
for itm in current Project
{ if (type(itm) != "Formal")
continue
NameModFull = fullName(itm)
put(skpNames, NameModFull, NameModFull)
}
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.