Standard Pascal does not make provision for the string data type, but most modern compilers do. Experienced Pascal programmers also use pointers for dynamic memory allocation, objects for object-oriented programming, and many others, but this gets you started.

More information on Pascal data types:

The Integer data type can contain whole numbers. the size of an integer depends on the compiler and the processor. On PCs before the 80386, "integer" meant 16-bit whole numbers in the range from -32768 to 32767. This is the signed range that can be stored in a 16-bit word, and is a legacy of the era when 16-bit CPUs were common. For backward compatibility purposes, a 32-bit signed integer is a longint and can hold a much greater range of values, 2147483647 to -2147483648.

The Word data type is a 16-bit unsigned integer, which has a range of 0 to 65535.

The Real data type has a range from 3.4x10-38 to 3.4x1038, in addition to the same range on the negative side. Real values are stored inside the computer similarly to scientific notation, with a mantissa and exponent, with some complications. In Pascal, you can express real values in your code in either fixed-point notation or in scientific notation, with the character E separating the mantissa from the exponent. Thus, 452.13 is the same as 4.5213e2

The Char data type holds characters. Be sure to enclose them in single quotes, like so: 'a' 'B' '+' Standard Pascal uses 8-bit characters, not 16-bits, so Unicode, which is used to represent all the world's language sets in one UNIfied CODE system, is not supported.

The WideChar is a two-byte character (an element of a DBCS: Double Byte Character Set) and can hold a Unicode character. Note: some Unicode characters require two WideChars. See UTF-16.

Free Pascal supports the Delphi implementation of the PChar data type. PChar is defined as a pointer to a Char type, but allows additional operations. The PChar type can be understood best as the Pascal equivalent of a C-style null-terminated string, i.e. a variable of type PChar is a pointer that points to an array of type Char, which is ended by a null-character (#0). Free Pascal supports initializing of PChar typed constants, or a direct assignment. For example, the following pieces of code are equivalent:

programone;varP:PChar;beginP:='This is a null-terminated string.';WriteLn(P);end.

programtwo;constP:PChar='This is a null-terminated string.';beginWriteLn(P);end.

Free Pascal supports the String type as it is defined in Turbo Pascal: a sequence of characters with an optional size specification. It also supports AnsiStrings (with unlimited length) as in Delphi. And can be declared as:

variable_name:string;// if no length is given, it defaults to 255variable_name:string[length];// where: 1 < length <= 255

AnsiStrings are strings that have no length limit. They are reference counted and are guaranteed to be null terminated. Internally, an ansistring is treated as a pointer: the actual content of the string is stored on the heap, as much memory as needed to store the string content is allocated.

WideStrings (used to represent unicode character strings) are implemented in much the same way as ansistrings: reference counted, null-terminated arrays, only they are implemented as arrays of WideChars instead of regular Chars.