Dollar sign/pt: what changed
Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | - | ||
| 2 | - | ||
| 3 | 1 | \$ | |
| 4 | - | ||
| 5 | - | ||
| 6 | 2 | ||
| 7 | 3 | Em [[ASCII/pt|ASCII]], o código decimal de caractere `36` (ou hexadecimal `24`) é definido para ser `$` (sinal de dólar). | |
| 8 | 4 | ||
| 9 | 5 | ## Pascal | |
| 10 | 6 | ||
| 11 | 7 | O símbolo `$`, pronúnciado “sinal de dólar”, é usado em [[Pascal/pt|Pascal]] para indicar uma base [[Hexadecimal/pt|hexadecimal]].\ | |
| 12 | 8 | ||
| 13 | 9 | ``` pascal | |
| 14 | 10 | program dollarSignDemo(input, output, stderr); | |
| 15 | 11 | ||
| 16 | 12 | var | |
| 17 | 13 | i: longint; | |
| 18 | 14 | ||
| 19 | 15 | begin | |
| 20 | 16 | // '$' bem como '0x' são reconhecidos por readLn | |
| 21 | 17 | // como prefixos de base hexadecimal | |
| 22 | 18 | readStr('$24', i); | |
| 23 | 19 | writeLn(i); // will print 36 | |
| 24 | 20 | writeLn(-$24); // will print -36 | |
| 25 | 21 | end. | |
| 26 | 22 | ``` | |
| 27 | 23 | ||
| 28 | 24 | Um sinal opcional é escrito na frente do indicador de base. | |
| 29 | 25 | ||
| 30 | 26 | ## Outras situações | |
| 31 | 27 | ||
| 32 | 28 | Nos compiladores [[FPC/pt|FPC]] e [[Delphi/pt|Delphi]], o sinal de dólar aparece em [[Compiler directive/pt|diretivas de compilação]] da forma `{$directive}`. | |
| 33 | 29 | ||
| 34 | 30 | --- | |
| 35 | 31 | *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](/wiki-contact).* |
