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

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

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

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

Parameters

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

Return Value

Type: System..::..Int32
The decremented value.

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