skip to main content
Corticon Studio: Rule Language Guide : Rule operator details and examples : Decrement
 

Try Corticon Now

Decrement

SYNTAX

<Number1> -= <Number2>

DESCRIPTION

Decrements <Number1> by the value of <Number2>. The data type of <Number1> must accommodate the subtraction of <Number2>. In other words, an Integer may not be decremented by a Decimal without using another operator (such as .toInteger or Floor) to first convert the Decimal to an Integer.

USAGE RESTRICTIONS

The Operators row of the table in Vocabulary usage restrictions does not apply. Special exceptions: decrement may only be used in Action Rows (section 5 in Sections of Rulesheet that correlate with usage restrictions).

RULESHEET EXAMPLE

This sample Rulesheet uses decrement to reduce integer1 by the value of integer2 when boolean1 is false.

SAMPLE RULETEST

A sample Ruletest provides three examples of integer1, integer2, and boolean1. Input and Output panels are shown below.