Main Content

deleteLinks

Delete links for line ranges

Since R2022b

    Description

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

    example

    Examples

    collapse all

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

    Load the links data associated with the myAdd code file and load the myAddRequirements requirement set.

    file = "myAdd.m";
    slreq.load(file);
    rs = slreq.load("myAddRequirements");

    Get the slreq.TextRange object associated with line 1 in the myAdd function.

    cr = slreq.getTextRange(file,1);

    Get the links associated with the slreq.TextRange object.

    links = getLinks(cr)
    links=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 1.

    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