Difference between revisions of "Dollar sign"
From Lazarus wiki
Jump to navigationJump to searchm |
(bla) |
||
Line 1: | Line 1: | ||
− | {{ | + | {{Dollar sign}} |
<div style="float:left; margin: 0 25px 20px 0; padding:40px; font-size:500%; font-family: Georgia; background-color: #f9f9f9; border: 2px solid #777777;">$</div> | <div style="float:left; margin: 0 25px 20px 0; padding:40px; font-size:500%; font-family: Georgia; background-color: #f9f9f9; border: 2px solid #777777;">$</div> | ||
+ | In [[ASCII]], the character code decimal <syntaxhighlight lang="pascal" enclose="none">36</syntaxhighlight> (or hexadecimal <syntaxhighlight lang="pascal" enclose="none">24</syntaxhighlight>) is defined to be <syntaxhighlight lang="pascal" enclose="none">$</syntaxhighlight> (dollar sign). | ||
− | The symbol $ | + | == Pascal == |
+ | The symbol <syntaxhighlight lang="pascal" enclose="none">$</syntaxhighlight>, pronounced “dollar sign”, is used in [[Pascal]] to indicate a [[Hexadecimal|hexadecimal]] base. | ||
− | + | <syntaxhighlight lang="pascal"> | |
+ | program dollarSignDemo(input, output, stderr); | ||
+ | var | ||
+ | i: longint; | ||
− | + | begin | |
+ | // '$' as well as '0x' are recognized by readLn | ||
+ | // as hexadecimal base prefixes | ||
+ | readStr('$24', i); | ||
+ | writeLn(i); // will print 36 | ||
+ | writeLn(-$24); // will print -36 | ||
+ | end. | ||
+ | </syntaxhighlight> | ||
+ | An optional sign is written in front the base indicator. | ||
+ | |||
+ | == other appearances == | ||
+ | For [[FPC]] and [[Delphi]] compilers, the dollar sign appears in compiler directives of the form <syntaxhighlight lang="pascal" enclose="none">{$directive}</syntaxhighlight>. | ||
[[Category:Symbols]] | [[Category:Symbols]] | ||
[[Category:Pascal]] | [[Category:Pascal]] |
Revision as of 01:24, 13 April 2018
│
English (en) │
suomi (fi) │
français (fr) │
português (pt) │
русский (ru) │
$
In ASCII, the character code decimal 36
(or hexadecimal 24
) is defined to be $
(dollar sign).
Pascal
The symbol $
, pronounced “dollar sign”, is used in Pascal to indicate a hexadecimal base.
program dollarSignDemo(input, output, stderr);
var
i: longint;
begin
// '$' as well as '0x' are recognized by readLn
// as hexadecimal base prefixes
readStr('$24', i);
writeLn(i); // will print 36
writeLn(-$24); // will print -36
end.
An optional sign is written in front the base indicator.
other appearances
For FPC and Delphi compilers, the dollar sign appears in compiler directives of the form {$directive}
.