![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Simple Link Topic Summary: Created On: 10-Feb-2004 15:39 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: I wanted to create a set of links in Excel that would link as previously described. The link criteria, which I am not responsible for, is not always consistant and can be based on more than one attribute. I found a way to link objects by passing their Absolute Numbers through a function. The attached code is what I came up with. Any improvements/comments are welcome. Thanks again. | |
![]() |
|
Thanks in advance for your help. I want to link object 1 in module A to object 2 in module B.
This code links object 1 to object 2 in module A. (object 1) -> modLink -> (object 2) where modLink is the link module. I am having trouble indicating object 2 is in module B. Any ideas? |
|
![]() |
|
![]() |
|
the "object" parameters need to be of type "Object"; specifically they are NOT absolute numbers or paragraph numbers. Once you have the handle (in an open module) DXL knows what module its in.
Seems to me there was a command "find" that found Objects given the Absolute Number, but I cannot find it in the manual. You may want to trap errors: noError() oSource ->NameLM ->oTarget string ErrMess = lastError() if (!null ErrMess) print "Failed to create link: " ErrMess That's better than having your DXL abort if there is an error, such as if you forget to open the source module Edit. - Louie |
|
![]() |
|
![]() |
|
I think I have read the help/manual at least five times. It seems like it should be no big deal. Ideally what I would like to do is link absolute numbers from module A to module B. It isn't the syntax but it would look like this:
(module A (absolute number 1)) -> modLink -> (module B (absolute number 2)) |
|
![]() |
|
![]() |
|
Are you saying you know the AbsNos of the two objects, but need to translate them into "Object"s?
|
|
![]() |
|
![]() |
|
I know both absolute numbers but can't get the link to work. I can link within the module I am currently in but can't find a way to link absolute numbers across modules. It should be one line of DXL.
|
|
![]() |
|
![]() |
|
I don't understand "linking absolute numbers". Maybe you need to post some code.
But I did just locate the command in the "New" section of the v6 manual but cannot find it in the body of the manual. Looks like its: Object object(int AbsNo): find the Object with that AbsNo. This command only seems to work on the "current" module. To use it on another module you'll need to issue something like: (current ModuleRef__) = modTarget Object oTarget = object(AbsNo) Don't forget to change the current module back when searching for the Source module. Edit: v7 manual has an optional parameter Object oTarget = object(AbsNo, mTarget) which will relieve you the need to switch current modules. There is a great chance that command works in v6 as well. If memory serves this command only finds currently displayed objects, not any object. That pretty much puts it in the "don't bother using it" pile. Instead, I wrote my own clever searcher that works best when you are searching the same module repeatedly. - Louie Edited: 10-Feb-2004 at 21:53 by Louie Landale |
|
![]() |
|
![]() |
|
I wanted to create a set of links in Excel that would link as previously described. The link criteria, which I am not responsible for, is not always consistant and can be based on more than one attribute. I found a way to link objects by passing their Absolute Numbers through a function. The attached code is what I came up with. Any improvements/comments are welcome. Thanks again.
|
|
![]() |
|
![]() |
|
In a previous post I mentioned noError()/lastError() code to trap errors.
Be advised that the "for obj in mod" loop only works for DISPLAYED objects. If the default module view for these modules has some sort of Filter on it, then not all live objects will be displayed and therefore not all objects will be FOUND by your loops. Dealing with this is a little tricky. Use the "for obj in entire mod" loop, then make sure the found object isn't a row(o), table(o), isDeleted(o). Its "bad practice" to use lots of global variables. In this case you should declare o,e,i, and j INSIDE the ABS_Link function. I'd put "counter" in there also but return it as a call parameter, and of course change "void ABS_Link" to "int ABS_Link". The for o in mod loops are relatively slow. In fact, lots of object searches WILL bog down the DXL. For repeated searches its quite a bit faster to put all the Objects and their AbsNos in a Skip list, then search the Skip list. - Louie - Louie |
|
![]() |
|
![]() |
|
Thanks for the good information/ideas. I happen to discover the “for o in m” loop
only applies to visible objects. I think it is almost a desirable feature if working with subsets of data. If I put the variables inside function does DXL create and destroy their allocation with every function call or once during run time? I hated to brute force the linking but could not find another alternative. I know about the skip list but have not started using them yet. I am still getting my DXL feet wet. In a test environment the posted script linked 10,000 objects in less than 4 minutes. |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Simple Link
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.