Contenuto principale

getLinks

Get links for line range

Since R2022b

    Description

    myLinks = getLinks(lr) returns the links associated with the line range lr.

    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)

    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

    Links, returned as an slreq.Link array.

    Version History

    Introduced in R2022b