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ə278/294
tarix02.01.2022
ölçüsü0,84 Mb.
#41395
1   ...   274   275   276   277   278   279   280   281   ...   294
DelphiLanguageGuide

String Constants
String constants must be enclosed in single or double quotation marks. Two consecutive quotation marks of the
same type as the enclosing quotation marks count as only one character. Here are some examples of string
constants:
 'Z'
 'Delphi'
 'Linux'
 "That's all folks"
 '"That''s    all folks," he said.'
 '100'
 '"'
 "'" 
String constants of any length are allowed in DB directives, and cause allocation of a sequence of bytes containing
the ASCII values of the characters in the string. In all other cases, a string constant can be no longer than four
characters and denotes a numeric value which can participate in an expression. The numeric value of a string
constant is calculated as
234


Ord(Ch1) + Ord(Ch2) shl 8 + Ord(Ch3) shl 16 + Ord(Ch4) shl 24
where 
Ch1
 is the rightmost (last) character and 
Ch4
 is the leftmost (first) character. If the string is shorter than four
characters, the leftmost characters are assumed to be zero. The following table shows string constants and their
numeric values.

Yüklə 0,84 Mb.

Dostları ilə paylaş:
1   ...   274   275   276   277   278   279   280   281   ...   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