Sign in Join
Wiki copytemporary

Revision 2 of 2, by Kai Burghardt on 8-6-2022. The page as it is now.

Dollar sign/pt

$

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.