$CurrentLink

$CurrentLink
is the LinkObject representing the MathLink connection for an external program currently being installed or being called.

DetailsDetails

  • $CurrentLink is temporarily set by Install and by .
  • You can use $CurrentLink to distinguish between several instances of an external program running at the same time.
  • $CurrentLink can be included in :Pattern: and MathLink template specifications, and will be evaluated at the time when Install is called.

ExamplesExamplesopen allclose all

Basic Examples (1)Basic Examples (1)

Set the directory:

In[1]:=
Click for copyable input

Install two instances of external MathLink-compatible programs:

In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=

Get usage information about linked-in symbols:

$CurrentLink is used keep track of different persistent variables:

In[5]:=
Click for copyable input
Out[5]=

Update the value of the counter:

In[6]:=
Click for copyable input
Out[6]=

Check the value of the two counters:

In[7]:=
Click for copyable input
Out[7]=

Terminate the external programs:

In[8]:=
Click for copyable input
Out[8]=

Reset to the original directory:

In[9]:=
Click for copyable input
New in 3
New to Mathematica? Find your learning path »
Have a question? Ask support »