PreIncrement
PreIncrement[a]
adds 1 to a
and returns the new value.
Attributes[PreIncrement] := {HoldFirst, Protected, ReadProtected}
Simple examples
In[1]:= toModify = 3 Out[1]= 3
In[2]:= PreIncrement[toModify] Out[2]= 4
In[3]:= toModify Out[3]= 4