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

$ModuleNumber

$ModuleNumber
gives the current serial number to be used for local variables that are created.
  • You can reset $ModuleNumber to any positive integer, but if you do so, you run the risk of creating naming conflicts.
Each use of Module increments $ModuleNumber:
You can reset $ModuleNumber:
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]=
Use a unique module number in your Mathematica session:
$ModuleNumber will now increment starting from this number:
$ModuleNumber is also used by Unique to create new symbols from given ones:
If given a string, it creates the first available symbol of the form xnnn:
New in 2