[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'System' (#rtl)

Chr

Convert byte value to character value

Declaration

Source position: systemh.inc line 1208

function Chr(

  b: Byte

):Char;

Description

Chr returns the character which has ASCII value X.

Historical note:

Originally, Pascal did not have typecasts and chr was a necessary function in order to do certain operations on ASCII values of characters. With the arrival of typecasting a generic approach became possible, making chr mostly obsolete. However, chr is not considered deprecated and remains in wide use today.

Errors

None.

See also

Ord

  

Return ordinal value of an ordinal type.

Str

  

Convert a numerical or enumeration value to a string.

Example

Program Example8;

{ Program to demonstrate the Chr function. }

begin
  Write (chr(10),chr(13)); { The same effect as Writeln; }
end.


Documentation generated on: May 14 2021