Sign in Join
Wiki copytemporary

Percent sign: what changed

Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11%
22
33In [[ASCII]], the character code decimal `37` (or [[Hexadecimal|hexadecimal]] `25`) is defined to be `%` .
44
55The symbol `%` (pronounced "percent sign") is used in [[Pascal]]:
66
77- it indicates a [[Binary numeral system|binary numeral expression/number]].
88
99The percent sign also appears in Lazarus [[IDE directives]] of the form `{%directive}`
1010
1111## Example
1212
1313``` pascal
1414
1515program simple_binary_digit;
1616
1717var b:byte;
1818begin
1919 b := %1010011;
2020 writeln (b);
2121 writeln (binStr(b,8));
2222 writeln ;
2323 writeln ('Press [Enter] to finish');
2424 readln;
2525end.
2626```
2727
2828The output prints as follows:
2929
30-`83`\
31-`01010011`\
32-` `\
33-`Press [enter] to finish`
30+```text
31+83
32+01010011
33+
34+Press [enter] to finish
35+```
3436
3537> **Note:** Binary number literals are not supported in [[Mode Delphi|{$mode Delphi}]] and [[Mode TP|{$mode TP}]].
3638
3739## See also
3840
3941- `function` [[doc:rtl/system/binstr.html|binStr]] - Convert [[Integer|integer]] to [[String|string]] with binary representation.
4042
4143---
4244*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](/wiki-contact).*

Back to history