Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica >

$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 :Arguments: 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 link1 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 link1 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
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team