1.8 Character strings

A character string (or string for short) is a sequence of zero or more characters (byte sized), enclosed in single quotes, and on 1 line of the program source. A character set with nothing between the quotes (’’) is an empty string.

_________________________________________________________________________________________________________Character strings
--character string--|quoted string ------------------------------------
                |-control string--|
                ----------------

--quoted string- ’--|string character---’-------------------------------
                 ---------------

--string character--- Any character except ’ or CR----------------------
                ------------”-------------|

--control string--#  -unsigned integer-------------------------------
              -------------------|
___________________________________________________________________

The string consists of standard, 8-bit ASCII characters. The control string can be used to specify characters which cannot be typed on a keyboard, such as #27 for the escape character.

The single quote character can be embedded in the string by typing it twice. The C construct of escaping characters in the string (using a backslash) is not supported in Pascal.

It is possible to use other character sets in strings: in that case the codepage of the source file must be specified with the {$CODEPAGE XXX} directive or with the -Fc command line option for the compiler. In that case the characters in a string will be interpreted as characters from the specified codepage.