|
Whitebeam Template Reference Documentation
|
System Template
testAndSet()
Call this method to set the value stored in a counter. The change only takes place if the counter
contains the 'testValue', or does not currently exist.
Syntax
count = rb.counter.testAndSet(counterName, testValue, newValue, maxLifeTime)
Parameters
The 'testAndSet' method takes 4 parameters:
Name | Type/Value | Range/Length | Description | counterName | string | | Required. The name of the counter | testValue | number | | Required. The value to test against the counter. | newValue | number | | Required. If the test value matches - then change the value in the counter to this value. | maxLifeTime | number | | Optional, default = 1800 Maximum time (in seconds) this variable will exist if it is not read or updated by the system. The default is 1800 (30 minutes). |
Results
The 'testAndSet' method returns structure:
Example |
|
(loadtime : 122ms) |