Release 10.1A: OpenEdge Development:
Progress Dynamics Advanced Development

> ## Link support methods

> There are several additional methods that are used to modify and support links, including the following.

> ##### removeLink, removeAllLinks, removeUserLinks

> These functions delete one or links from an object. The `removeLink` function removes a specific link between two objects, as shown:

>     Procedure removeLink:
>       Parameters:  INPUT phSource AS HANDLE -- source procedure handle,
>                    INPUT pcLink   AS CHARACTER -- link type name,
>                    INPUT phTarget AS HANDLE -- link target object handle
>       Candidate for: calling
>         If your code needs to remove a specific link between two objects, it should
>     use this call.

> Your code does not normally run `removeAllLinks`, which deletes all standard (supported) links from an object. This includes deleting link definitions in the objects at the other end of the links, which is done automatically when the object is destroyed.

> The procedure `removeUserLinks` removes user-defined links, which are not on the `SupportedLinks` list.

> ##### assignLinkProperty

> This `LOGICAL` property sets a property value in an object at the other end of a specified link, relative to the current object (`TARGET-PROCEDURE`), as shown:

>     Function assignLinkProperty()
>       Parameters:  INPUT pcLink AS CHARACTER -- Link Type,
>                    INPUT pcPropName AS CHARACTER -- Property Name,
>                    INPUT pcPropValue AS CHARACTER -- Property Value.
>       Returns: LOGICAL (success flag)
>       Candidate for: calling
>         You can use this function when you know the name of the link that connects
>     the current object to another, but not the handle of the object at the other
>     end of the link. This allows you to set the property based on the relationship
>     between the objects without having to retrieve the handles. If there’s more
>     than one object at the other end of the link, the property is set in all of
>     them.

> ##### linkHandles

> This `CHARACTER` function takes a link name and returns a list of handles of objects at the other end of that link, relative to the current object (the `TARGET-PROCEDURE`), as shown:

>     Function linkHandles()
>        Params: pcLink AS CHARACTER -- Link name (including "-SOURCE" or "-TARGET")
>        Candidate for: calling
>         Your code can use this function to retrieve a list of the procedure handles
>     of the object or objects connected to the current object (the one the function
>     is invoked in) by the link you specify. This could be useful if you need to
>     do something beyond just setting a property value (for which you could use
>     assignLinkProperty).

> ##### linkProperty

> This `CHARACTER` function returns the value of the requested property in the object at the other end of the specified link, relative to the `TARGET-PROCEDURE`. Parallel to the `assignLinkProperty` function, this one retrieves the value of a property using the link name rather than the object’s handle.

> If there is more than one object at the other end of the link (or none), the function returns blank, as shown:

> .

>     Function linkProperty()
>        Params:  INPUT pcLink     AS CHARACTER -- Link name,
>                 INPUT pcPropName AS CHARACTER -- Property name.
>      Candidate for: calling
>         You can invoke this function in your code to retrieve a property value
>     when you know the link that associates two objects but not the handle of the
>     object at the other end of the link.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095