![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Skip List weird Topic Summary: Created On: 22-Jan-2004 17:31 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() 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. | |
![]() |
|
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? |
|
![]() |
|
![]() |
|
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. |
|
![]() |
|
![]() |
|
yes the declaration I am using is;
Skip MySkipList = createString |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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.
|
|
![]() |
|
![]() |
|
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) } |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Skip List weird
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.