Sign in Join
Wiki copytemporary

Dollar sign/pt

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

$

Em ASCII, o código decimal de caractere 36 (ou hexadecimal 24) é definido para ser $ (sinal de dólar).

Pascal

O símbolo $, pronúnciado “sinal de dólar”, é usado em Pascal para indicar uma base hexadecimal.\

pascal
program dollarSignDemo(input, output, stderr);

var
    i: longint;

begin
    // '$' bem como '0x' são reconhecidos por readLn
    // como prefixos de base hexadecimal
    readStr('$24', i);
    writeLn(i);    // will print  36
    writeLn(-$24); // will print -36
end.

Um sinal opcional é escrito na frente do indicador de base.

Outras situações

Nos compiladores FPC e Delphi, o sinal de dólar aparece em diretivas de compilação da forma {$directive}.


From the Free Pascal wiki, page "Dollar sign/pt", 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 2, last changed by WikiArchive .

Edited on wiki.freepascal.org by 2 people, 2019–2022

From the official wiki's backup of 26 May 2024: who edited this page there, and when. Edits made there after that date were not recorded, and the earlier versions are not shown here; the main page says why.

WhenWhoWhat changed
LeonardocoelhoCreated page
Kai Burghardtresolve Category: Pages using deprecated enclose attributes (minor)

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.