|
|
(6 intermediate revisions by 5 users not shown) |
Line 1: |
Line 1: |
− | = Dec =
| + | #REDIRECT [[Inc and Dec]] |
− | | |
− | | |
− | Dec (decrement) [[Procedure|procedure]] in Pascal programming let you easily subtract 1 (or some other value) from, a [[Variable|variable]].
| |
− | | |
− | For example, using (decrement) procedure, you can reduce 1 to a variable named a like this:
| |
− | | |
− | <syntaxhighlight>
| |
− | dec( a );
| |
− | </syntaxhighlight>
| |
− | | |
− | If you want to reduce by two (or some other value):
| |
− | | |
− | <syntaxhighlight>
| |
− | dec( a, 2 );
| |
− | </syntaxhighlight>
| |
− | | |
− | Dec procedure included [[System]] [[Unit]]. | |
− | | |
− | | |
− | == See also ==
| |
− | | |
− | * Link to RTL documentation: [[doc:rtl/system/dec.html |dec]]
| |
− | * [[Inc]] - Increase value of integer variable.
| |
− | * Link to RTL documentation: [[doc:/rtl/system/pred.html |pred]] - Return previous element for an ordinal type.
| |
− | * [[For]] control_variable := start_point [[Downto]] end_point [[Do]] statement.
| |