Sign in Join
Wiki copytemporary

Percent sign: what changed

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

OldNewLine
1-<div style="float:right; margin: 0 25px 20px 0; padding:40px; font-size:500%; font-family: Georgia; background-color: #f9f9f9; border: 2px solid #777777;">
2-
31%
4-
5-</div>
62
73In [[ASCII]], the character code decimal `37` (or [[Hexadecimal|hexadecimal]] `25`) is defined to be `%` .
84
95The symbol `%` (pronounced "percent sign") is used in [[Pascal]]:
106
117- it indicates a [[Binary numeral system|binary numeral expression/number]].
128
139The percent sign also appears in Lazarus [[IDE directives]] of the form `{%directive}`
1410
1511## Example
1612
1713``` pascal
1814
1915program simple_binary_digit;
2016
2117var b:byte;
2218begin
2319 b := %1010011;
2420 writeln (b);
2521 writeln (binStr(b,8));
2622 writeln ;
2723 writeln ('Press [Enter] to finish');
2824 readln;
2925end.
3026```
3127
3228The output prints as follows:
3329
3430`83`\
3531`01010011`\
3632` `\
3733`Press [enter] to finish`
3834
3935> **Note:** Binary number literals are not supported in [[Mode Delphi|{$mode Delphi}]] and [[Mode TP|{$mode TP}]].
4036
4137## See also
4238
4339- `function` [[doc:rtl/system/binstr.html|binStr]] - Convert [[Integer|integer]] to [[String|string]] with binary representation.
4440
4541---
4642*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