This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

$CurrentLink

$CurrentLink
is the LinkObject representing the MathLink connection for an external program currently being installed or being called.
  • 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.
Set the directory:
Install two instances of external MathLink-compatible programs:
Get usage information about linked-in symbols:
$CurrentLink is used keep track of different persistent variables:
Update the value of the counter:
Check the value of the two counters:
Terminate the external programs:
Reset to the original directory:
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