Constant: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: Constant
| Old | New | Line | |
|---|---|---|---|
| 1 | + | A **constant** is a [[Variable|variable]] that does not change, it has a final value. | |
| 2 | + | ||
| 3 | + | Constants are defined in the [[Const|const section]] of a [[FPC|Free Pascal]] [[Program|program]]. When a symbol is defined as constant, the [[Compiler|Free Pascal compiler]] can often do some optimizations to make the output code faster or smaller. | |
| 4 | + | ||
| 5 | + | Some special Free Pascal constants are: | |
| 6 | + | ||
| 7 | + | Logical truth values | |
| 8 | + | ||
| 9 | + | - [[False|false]] | |
| 10 | + | - [[True|true]] | |
| 11 | + | ||
| 12 | + | data type limits | |
| 13 | + | ||
| 14 | + | - [[Nil|nil]]: empty [[Pointer|pointer]] value | |
| 15 | + | - [[maxint]]: largest possible [[Integer|integer]] value | |
| 16 | + | ||
| 17 | + | The mathematical value [[Pi|π]] is realized as a function in [`system.pi`](https://www.freepascal.org/docs-html/rtl/system/pi.html). | |
| 18 | + | ||
| 19 | + | ## See also | |
| 20 | + | ||
| 21 | + | - [[Const|const]] | |
| 22 | + | - [[Basic Pascal Tutorial/Chapter 1/Constants|Constants]] | |
| 23 | + | - [[Class constants]] | |
| 24 | + | ||
| 25 | + | --- | |
| 26 | + | *From the Free Pascal wiki, page "Constant", as it stood on 2023-02-23 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
