{{htmlmetatags>metatag-robots=()
metatag-title=(DEC | ugBASIC User Manual)
metatag-keywords=(ugBASIC,Commodore 64,Commodore PLUS/4,ZX Spectrum)
metatag-description=(Manual page for DEC)
metatag-media-og:image=(:ugbasic:logo-ugbasic-fb.png)
metatag-og:title=(DEC | ugBASIC User Manual)
metatag-og:description=(Manual page for DEC)
}}
====== ugBASIC User Manual ======
===== DEC =====
===== SYNTAX =====
DEC variable
==== PURPOSE ====
The ''DEC'' command is used to decrement (i.e. decrease) the value
of a numeric variable by one. It is a quick and concise way to subtract
1 from the value contained in a variable. In place of ''variable'', enter the
name of the numeric variable you want to decrement.
The ''DEC'' command is actually a shorthand for the subtraction operation, as
writing ''num=num-1''. However, ''DEC'' is often preferred because of its
more concise syntax and its specific decrement function. The ''DEC'' command
can only be applied to numeric variables (integer).
==== EXAMPLE ====
x = 43
DEC x
PRINT x: ' It prints "42"
==== ABBREVIATION ====
Dc
==== AVAILABLE ON ====
==== SEE ALSO ====
[[INC]]
==== ANY PROBLEM? ====
If you have encountered a problem using this command, if you think there is a bug or the explanation is unclear, please [[https://github.com/spotlessmind1975/ugbasic/issues/new?title=ISSUE ON DEC|open an issue]] for this keyword on GitHub. Thank you!===== POWERED BY =====
[[:ugbasic:user:index|{{ :ugbasic:user:logo-ugbasic.png?nolink&600 |}}]]