Difference between revisions of "Const"

From Free Pascal wiki
Jump to navigationJump to search
m
Line 4: Line 4:
  
 
In some Pascal compilers, the Const declaration is used to define variables which are initialized at compile time to a certain specific value, and that the variables so defined can change as the program executes.  This can be used for initializing arrays at compile time as opposed to setting values when the program is executed.
 
In some Pascal compilers, the Const declaration is used to define variables which are initialized at compile time to a certain specific value, and that the variables so defined can change as the program executes.  This can be used for initializing arrays at compile time as opposed to setting values when the program is executed.
 +
<br>
 +
<br>
 +
 +
[[category:Pascal]]

Revision as of 17:58, 19 October 2012

Deutsch (de) English (en) español (es) suomi (fi) français (fr) 中文(中国大陆)‎ (zh_CN)

The declaration const in a Pascal program is used to inform the compiler that certain identifiers which are being declared are constants, that is, they are initialized with a specific value at compile time as opposed to a variable which is initialized at run time.

In some Pascal compilers, the Const declaration is used to define variables which are initialized at compile time to a certain specific value, and that the variables so defined can change as the program executes. This can be used for initializing arrays at compile time as opposed to setting values when the program is executed.