Difference between revisions of "Constant"

From Lazarus wiki
Jump to navigationJump to search
(review)
m (linkfix)
Line 14: Line 14:
 
data type limits
 
data type limits
 
* <code>[[Nil|nil]]</code>: empty pointer value
 
* <code>[[Nil|nil]]</code>: empty pointer value
* <code>[[Maxint|maxint]]</code>: largest possible <code>[[Integer|integer]]</code> value
+
* <code>[[maxint]]</code>: largest possible <code>[[Integer|integer]]</code> value
  
  

Revision as of 14:26, 24 January 2018

English (en) suomi (fi) français (fr) русский (ru) 中文(中国大陆)‎ (zh_CN)

A constant is a variable that does not change, it has a final value.

Constants are defined in the const section of a Free Pascal program. When a symbol is defined as constant, the Free Pascal compiler can often do some optimizations to make the output code faster or smaller.


Some special Free Pascal constants are:

Logical truth values

data type limits


The mathematical value π is realized as a function in System.Pi, so you may shadow (redefine) it on your own.

see also