Hello
LinkRef lnkRefWork;
for lnkRefWork in (objSource<-sLinkModuleName) do {
}
We all know the loops running over all Links resp. LinkRefs. Inside a Linkref I want to place the line:
Object objSource = source(lnkRefWork);
SystemAdmin - Tue Jan 29 03:06:40 EST 2013 |
Re: Is there a direct conntection from Link to LinkRef? |
Re: Is there a direct conntection from Link to LinkRef?
You could use the LinkRef to get the module name and absolute number of the source object. You can then use that info to get the source object directly:
LinkRef lnkRefWork;
for lnkRefWork in (objSource<-sLinkModuleName) do {
ModName_ srcModRef = source(lnkRefWork)
int srcAbsNum = source(lnkRefWork)
Module srcMod = read(fullName(srcModRef), false)
Object objSource = object(srcAbsNum, srcMod)
}
|
Re: Is there a direct conntection from Link to LinkRef? I dislike the "object(AbsNo)" command as it is restricted to the current display set which is restricted to the default view for the module. I think you are stuck with the customary approach:
-Louie |
Re: Is there a direct conntection from Link to LinkRef? The LinkRef is the little yellow in-link marker, that is placed on an object to indicate that there is a link ending from somewhere on that object. You need this LinkRef only, to find out, which modules to open, so all links will that end in the module will be loaded to memory. If for example you already knew the modules from where you receive links, then you could just open them without thinking about LinkRefs and then iterate over Links directly. Therefore you can see, why there is a) no connection between Link and LinkRef -> these are separate things. b) no source function for the LinkRef -> a LinkRef is no link, therefore it does not carry information about the link, like creation dates, etc. c) you need to explicitly have a loop to open the source modules, and the real loop to iterate over the links Maybe that clears matters up, regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Is there a direct conntection from Link to LinkRef? Mathias Mamsch - Tue Jan 29 14:42:23 EST 2013 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS Thanks for the answer. My Intention is: Two loops seems to look like a little oversized code and I thought to reduce it. But if I cannot - ok. Best regards Wolfgang |
Re: Is there a direct conntection from Link to LinkRef? SystemAdmin - Tue Jan 29 11:19:50 EST 2013 You cannot alter the internal structure of a thing by renaming it. A renamed problem is still a problem. But a renamed solution is a solution. It may me to expensive, to complicate, stupid, senseless or whatever. The most important point is: You have a solution and the other has not. P.S.: It is very strange here. Sometimes the editor gimicks work and sometimes not. |