$ModuleNumber

$ModuleNumber

gives the current serial number to be used for local variables that are created.

Details

  • $ModuleNumber is incremented every time Module or Unique is called.
  • Every Wolfram System session starts with $ModuleNumber set to 1.
  • You can reset $ModuleNumber to a positive machine integer, but if you do so, naming conflicts may lead to inefficiencies.

Examples

open allclose all

Basic Examples  (2)

Each use of Module increments $ModuleNumber:

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

You can reset $ModuleNumber:

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

Applications  (1)

Properties & Relations  (1)

See Also

$ProcessID  Temporary

Tutorials

Introduced in 1991
(2.0)