Delphi Language Guide Delphi for Microsoft Win32 Delphi for the Microsoft. Net framework



Yüklə 0,84 Mb.
Pdf görüntüsü
səhifə120/294
tarix02.01.2022
ölçüsü0,84 Mb.
#41395
1   ...   116   117   118   119   120   121   122   123   ...   294
DelphiLanguageGuide

Constant Expressions
A constant expression is an expression that the compiler can evaluate without executing the program in which it
occurs. Constant expressions include numerals; character strings; true constants; values of enumerated types; the
special constants True, False, and nil; and expressions built exclusively from these elements with operators,
typecasts, and set constructors. Constant expressions cannot include variables, pointers, or function calls, except
calls to the following predefined functions:
Abs High
Low Pred
Succ
Chr Length Odd Round
Swap
Hi
Lo
Ord SizeOf Trunc
This definition of a constant expression is used in several places in Delphi's syntax specification. Constant
expressions are required for initializing global variables, defining subrange types, assigning ordinalities to values in
enumerated types, specifying default parameter values, writing case statements, and declaring both true and typed
constants.
Examples of constant expressions:
100
'A'
256 - 1
(2.5 + 1) / (2.5 - 1)
'Borland' + ' ' + 'Developer'
Chr(32)
Ord('Z') - Ord('A') + 1

Yüklə 0,84 Mb.

Dostları ilə paylaş:
1   ...   116   117   118   119   120   121   122   123   ...   294




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin