Difference between revisions of "Dec"

From Free Pascal wiki
Jump to navigationJump to search
Line 1: Line 1:
 
{{Dec}}
 
{{Dec}}
  
= Dec =
 
  
 
Dec (decrement) [[Procedure|procedure]] in Pascal programming let you easily subtract 1 (or some other value) from, a [[Variable|variable]].  
 
Dec (decrement) [[Procedure|procedure]] in Pascal programming let you easily subtract 1 (or some other value) from, a [[Variable|variable]].  
Line 26: Line 25:
 
* Link to RTL documentation: [[doc:/rtl/system/pred.html |pred]] - Return previous element for an ordinal type.
 
* 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.
 
* [[For]] control_variable := start_point [[Downto]] end_point [[Do]] statement.
 
[[Category:Pascal]]
 

Revision as of 21:15, 24 November 2015

Deutsch (de) English (en) suomi (fi) français (fr) русский (ru)


Dec (decrement) procedure in Pascal programming let you easily subtract 1 (or some other value) from, a variable.

For example, using (decrement) procedure, you can reduce 1 to a variable named a like this:

 dec( a );

If you want to reduce by two (or some other value):

 dec( a, 2 );

Dec procedure included System Unit.


See also

  • Link to RTL documentation: dec
  • Inc - Increase value of integer variable.
  • Link to RTL documentation: pred - Return previous element for an ordinal type.
  • For control_variable := start_point Downto end_point Do statement.