Collapse AllExpand All      Code: All Code: Multiple Code: Visual Basic Code: C# Code: Visual C++ Code: F# Code: JScript 
Increment Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Increments a specified variable and stores the result, as an atomic operation.

Namespace:   System.Threading
Assembly:  mscorlib (in mscorlib.dll)
Public Shared Function Increment ( _
	ByRef location As Integer _
) As Integer
public static int Increment(
	ref int location
static int Increment(
	int% location
static member Increment : 
        location:int byref -> int 
public static function Increment(
	location : int
) : int


Type: System..::..Int32%
The variable whose value is to be incremented.

Return Value

Type: System..::..Int32
The incremented value.

This method handles an overflow condition by wrapping: if location = Int32..::..MaxValue, location + 1 = Int32..::..MinValue. No exception is thrown.