Wiki copymirror

This is a mirror of the wiki at pascal.chat. Editing, history and sign-in are there.

Percent sign

English · Français · Português · Suomi · Русский

%

In ASCII, the character code decimal 37 (or hexadecimal 25) is defined to be % .

The symbol % (pronounced "percent sign") is used in Pascal:

The percent sign also appears in Lazarus IDE directives of the form {%directive}

Example

pascal

program simple_binary_digit;

var b:byte;
begin
  b := %1010011;
  writeln (b);
  writeln (binStr(b,8));
  writeln ;
  writeln ('Press [Enter] to finish');
  readln;
end.

The output prints as follows:

text
83
01010011
 
Press [enter] to finish

Note: Binary number literals are not supported in {$mode Delphi} and {$mode TP}.

See also


From the Free Pascal wiki, page "Percent sign", as it stood on 2022-08-06 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 3, last changed by WikiArchive .