MLINK MLDuplicateLink(MLINK parent, const char *name, int *err)
returns a copy of parent and sets the new link object's name to name.


  • The newly created link has an exact copy of the incoming and outgoing data streams of the parent link.
  • MLDuplicateLink() does not copy user data blocks.
  • Upon successful completion, MLDuplicateLink() returns a new link object and sets err to MLEOK.
  • In the event of an error, MLDuplicateLink() returns (MLINK)0 and sets err to the appropriate value.
  • MLDuplicateLink() is declared in the MathLink header file mathlink.h.

ExamplesExamplesopen allclose all

Basic Examples (1)Basic Examples (1)

#include "mathlink.h"

/* make a copy of a link */

    MLINK newlink;
    int error;

    newlink = MLDuplicateLink(lp, (const char *)"Duplicate 1", &error);
    if(newlink == (MLINK)0 || error != MLEOK)
        { /* unable to create a copy of the link */ }

    return newlink;
New to Mathematica? Find your learning path »
Have a question? Ask support »