Main Content

deleteLinks

Delete links for line ranges

    Description

    example

    count = deleteLinks(lr) deletes links associated with the line range lr and returns the number of deleted links.

    Examples

    collapse all

    This example shows how to remove an slreq.TextRange object.

    Open the myAdd code file.

    file = "myAdd.m";
    open(file);

    Get the slreq.TextRange object associated with lines 1–3 in the myAdd function.

    cr = slreq.getTextRange(file,[1 3]);

    Get the links associated with the slreq.TextRange object.

    links = getLinks(cr)
    links=1×3 object
      1×3 Link array with properties:
    
        Type
        Description
        Keywords
        Rationale
        CreatedOn
        CreatedBy
        ModifiedOn
        ModifiedBy
        Revision
        SID
        Comments
    
    

    Delete the links associated with the slreq.TextRange object.

    count = deleteLinks(cr)
    count = 3
    

    Remove the slreq.TextRange object associated with line number 3.

    remove(cr)

    Input Arguments

    collapse all

    Line range, specified as an slreq.TextRange object.

    Output Arguments

    collapse all

    Number of links removed, returned as a scalar double.

    Version History

    Introduced in R2022b