Difference between revisions of "Dollar sign"

From Lazarus wiki
Jump to navigationJump to search
(bla)
(attribute origin of hex-base)
(4 intermediate revisions by 3 users not shown)
Line 4: Line 4:
 
<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).
+
In [[ASCII]], the character code decimal <syntaxhighlight lang="pascal" inline>36</syntaxhighlight> (or hexadecimal <syntaxhighlight lang="pascal" inline>24</syntaxhighlight>) is defined to be <syntaxhighlight lang="pascal" inline>$</syntaxhighlight> (dollar sign).
  
 
== Pascal ==
 
== Pascal ==
The symbol <syntaxhighlight lang="pascal" enclose="none">$</syntaxhighlight>, pronounced “dollar sign”, is used in [[Pascal]] to indicate a [[Hexadecimal|hexadecimal]] base.
+
As a <abbr title="Pascal extension for scientific computing">PXSC</abbr>-extension, the symbol <syntaxhighlight lang="pascal" inline>$</syntaxhighlight>, pronounced “dollar sign”, is used to indicate a [[Hexadecimal|hexadecimal]] base.
 
+
<br style="clear:both" />
 
<syntaxhighlight lang="pascal">
 
<syntaxhighlight lang="pascal">
 
program dollarSignDemo(input, output, stderr);
 
program dollarSignDemo(input, output, stderr);
Line 26: Line 26:
  
 
== other appearances ==
 
== other appearances ==
For [[FPC]] and [[Delphi]] compilers, the dollar sign appears in compiler directives of the form <syntaxhighlight lang="pascal" enclose="none">{$directive}</syntaxhighlight>.
+
For [[FPC]] and [[Delphi]] [[Compiler|compilers]], the dollar sign appears in [[Compiler directive|compiler directives]] of the form <syntaxhighlight lang="pascal" inline>{$directive}</syntaxhighlight>.
  
[[Category:Symbols]]
+
{{Symbols}}
[[Category:Pascal]]
 

Revision as of 23:57, 3 February 2021

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

As a PXSC-extension, the symbol $, pronounced “dollar sign”, is used 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}.


navigation bar: topic: Pascal symbols
single characters

+ (plus)  •  - (minus)  •  * (asterisk)  •  / (slash)
= (equal)  •  > (greater than)  •  < (less than)
. (period)  •  : (colon)  •  ; (semi colon)
^ (hat)  •  @ (at)
$ (dollar sign)  •  & (ampersand)  •  # (hash)
' (single quote)

character pairs

<> (not equal)  •  <= (less than or equal)  •  := (becomes)  •  >= (greater than or equal)

 •  >< (symmetric difference)  •  // (double slash)