SharedData Decrement Method C# API
Decrements an integer value associated with the specified key in the Shared Data Server.

Namespace: Facilita.Fc.Runtime
Assembly: fc_clr (in fc_clr.dll) Version: 9.4.0.26
Syntax

public int Decrement(
	string key,
	int inc
)

Parameters

key
Type: System String
The key against which the value to be decremented is stored.
inc
Type: System Int32
The amount by which to decrement.

Return Value

The new, decremented value.
Remarks

The specified key must already be associated with a value, which can be set by calling Set(String, String) or SetInt(String, Int32). If the value associated with key is not a decrementable value then no action takes place.

A negative decrement value can be supplied.

Note Note
The keys are case-sensitive.

Examples

The following example demonstrates decrementing a value in the Shared Data Server.
using Facilita.Fc.Runtime;
SharedData sharedData = new SharedData(GetString("sharedDataHost", "localhost"), GetInt("sharedDataPort", 5099));
sharedData.Set("Count", "100");
sharedData.Decrement("Count");   // value will = 99
sharedData.Decrement("Count", 7);   // value will = 92
See Also