|
Dec | ||
Dec VariableToDecrease, [ OptionalAmount ] | ||
Parameters: VariableToDecrease = The integer or floating point variable you wish to subtract one from. [ OptionalAmount ] = The amount to subtract from this variable. If not provided this defaults to 1 |
||
Returns: NONE | ||
The Dec command gives us an easier way to subtract one from integer or float variables. FACTS: * Dec only works with Integer and Floating point variables. * Dec is shorthand for the expression Variable=Variable-1 * The Dec does Not work with Arrays or Types. * Note: PlayBASIC also support various math short Operators, such as -- , and -= which perform the same operation as Dec, but can be used upon any data type. Mini Tutorial: Set a variable to a value, dec it and display the effect.
This example will output
|
Related Info: | Inc | Operators : |
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |