![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: DXL utility to reorder links Topic Summary: Created On: 11-Mar-2004 16:33 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
You probably cannot change the actual order but you CAN change the order in which you display it. Algorithm may look like:
for each link put the link handle and target absno in a Skip. // Optionally put the Identifier in the Skip if links involve multiple target modules. CurrentAbsNo = -1 while (!Done) { for each link in the Skip find the smallest AbsNo that is Higher than CurrentAbsNo if no such AbsNo exists then we are Done. CurrentAbsNo = AbsNo display information about this link } You can generalize the function if the CurrentAbsNo and Skip are global variables (used only by the following functions) and you write two functions; one that initializes the Skip, gets the links from the specific objects and stores them in the Skip; and the 2nd function retrieves the "next" link from the Skip (and updates CurrentAbsNo). These generallized functions allow the caller to do whatever she wants with the links. I've done this Generalization using module names: got a function that gets the modules in the current folder and all sub-folders (it gets them in reasonable order) and puts them in a Skip. But the for module name in Skip loops seems to retrieve them irratically. So I inserted them into the Skip with an incremented Counter, and later I can retrieve them in inserted order. - Louie |
|
![]() |
|
![]() |
|
Don't know anything about the order of links found in the [1] for link in obj loop nor [2] displayed in the Edit Links dialog. I suppose, however, you could write a utility to capture all the links information, delete all the links, then recreate them in the desired order.
- Louie |
|
![]() |
|
![]() |
|
Thanks Louie for your hint.
My need was to present data in module B, following links to module A, where the data presented is the module A Object ID concatenated with some other atrribute info from module A. As the link order is not (always) predictable, I wanted to at least present the data in some predictable order. Following up on you hint I found that the Skiplist orders the data automatically in numerical order when the key is integer (using the Absolute Number from module A). See the code below: string s1 = "VAR-3000" string s2 = "VAR-10" string s3 = "VAR-200" int absNoID bool isendList = false string singlelist Regexp del = regexp "\n" Regexp varid1 = regexp "[0-9]*[0-9]" string s = s1 "\n" s2 "\n" s3 //Construct example string, representing link-based contents of an attribute Skip idList = create //Seperate Object IDs and put in Skiplist while(!isendList) { // Strip out singlestrings seperated by CR/LF if (del s) { singlelist = s [0:start 0-1] s = s [start 0+1:] } else { singlelist = s isendList = true } // Strip out integer from VAR-ID if (varid1 singlelist) { absNoID = intOf(singlelist [start 0:end 0]) // Or use Absolute Number directly as in trg."Absolute Number" put(idList,absNoID,singlelist) print singlelist ": " absNoID "\n" } } string varIDstr = "" print "Result:\n" for varIDstr in idList do { print varIDstr "\n" } delete(idList) Input and AbsNo: VAR-3000: 3000 VAR-10: 10 VAR-200: 200 Result: VAR-10 VAR-200 VAR-3000 ------------------------- Pieter de Waard www.nhindustries.com Edited: 23-Mar-2004 at 13:18 by Pieter DE WAARD |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
DXL utility to reorder links
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.