Topic
  • 2 replies
  • Latest Post - ‏2013-11-15T13:41:51Z by GregM_dxler
bandchef
bandchef
21 Posts

Pinned topic Access attribute via link?

‏2013-11-15T09:12:59Z |

Hi!

How can I access attributes via a link? I have following situation:

for lnk_InnerOutLink2 in gobj_CurrentObject2 -> "*" do

{

if(lnk_InnerOutLink2."c_This_is_a""" == "functional_requirements" && lnk_InnerOutLink2."c_Compliance""" == "yes")

{

}

}

 

I hope you can answer my question: Delivers the if statement lnk_InnerOutLink2."c_This_is_a""" == ... the correct attribute-value of the attribute of the object in a another module which the link "lnk_InnerOutLink2" points to???

 

Thx!

  • adevicq
    adevicq
    154 Posts

    Re: Access attribute via link?

    ‏2013-11-15T09:24:32Z  

    Hi,

    You get the target objet via the "target" function:

    Object o = target(l)
    

    o will be null if the target module is closed. You may have to open it prior to access the object.

    To open the target module use:

     

    Module loadModuleFromLink(Link l) {    
    ModuleVersion otherVersion = null 
    ModName_ otherMod = null 
    Module m = null 
    otherVersion = targetVersion l 
    otherMod = module(otherVersion) 
    if (null otherMod || isDeleted otherMod)    return null    
    noError   
    m = read(fullName(otherMod), true)    
    return m 
    }
    

     

    regards,

    alain

     

    Updated on 2013-11-15T09:58:28Z at 2013-11-15T09:58:28Z by adevicq
  • GregM_dxler
    GregM_dxler
    166 Posts

    Re: Access attribute via link?

    ‏2013-11-15T13:41:51Z  

    By the way, it would be nice if you didn't use such small font in your posts.