Sign in Join
Wiki copytemporary

&/pt: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11<div style="float:left; margin: 0 25px 20px 0; padding:40px; font-size:500%; font-family: Georgia; background-color: #f9f9f9; border: 2px solid #777777;">
22
33&
44
55</div>
66
7-Em [[ASCII/pt|ASCII]], o caractere de código decimal
8-
9-``` pascal
10-38
11-```
12-
13-(ou em \[\[Hexadecimal/pt\|
14-
15-``` pascal
16-$
17-```
18-
19-\]\]
20-
21-``` pascal
22-26
23-```
24-
25-) é, por definição,
26-
27-``` pascal
28-&
29-```
30-
31-(chamado de “E comercial”).
7+Em [[ASCII/pt|ASCII]], o caractere de código decimal `38` (ou em [[Hexadecimal/pt|$]]`26`) é, por definição, `&` (chamado de “E comercial”).
328
339## Pascal
3410
3511### Base octal
3612
37-Em [[Pascal/pt|Pascal]] o
38-
39-``` pascal
40-&
41-```
42-
43-denota um número em base octal.
13+Em [[Pascal/pt|Pascal]] o `&` denota um número em base octal.
4414
4515``` pascal
4616program messageNo(input, output, stderr);
4717
4818uses
4919 baseUnix;
5020
5121begin
5222 // withdraw group write access to current terminal
5323 // equivalent to invoking: mesg n
5424 fpChmod('/dev/stdin', &0600);
5525end.
5626```
5727
58-In an octal base only the characters
59-
60-``` pascal
61-0
62-```
63-
64-through and including
65-
66-``` pascal
67-7
68-```
69-
70-are allowed. An optional sign is specified in front of the
71-
72-``` pascal
73-&
74-```
75-
76-.
28+In an octal base only the characters `0` through and including `7` are allowed. An optional sign is specified in front of the `&`.
7729
7830As a passing remark, in a production program the number in the above example is better written as
7931
8032``` pascal
8133fpChmod('/dev/stdin', S_IRUSR or S_IWUSR);
8234```
8335
8436since it is more meaningful than having a raw number. Pascal is a high-level language. Use this advantage. Write what you *mean*, not what in fact the computer does.
8537
86-> **Note:** Literais numéricos em octal não são suportados pelos modos \[\[Mode Delphi/pt\|
87->
88-> ``` pascal
89-> {$mode Delphi}
90-> ```
91->
92-> \]\] e \[\[Mode TP/pt\|
93->
94-> ``` pascal
95-> {$mode TP}
96-> ```
97->
98-> \]\].
38+> **Note:** Literais numéricos em octal não são suportados pelos modos [[Mode Delphi/pt|{$mode Delphi}]] e [[Mode TP/pt|{$mode TP}]].
9939
10040### Caractere de escape
10141
102-[[FPC|FreePascal]] retroactively declared some new [[Reserved word|reserved words]]. In order of being capable of compiling old code with an up-to-date [[Compiler|compiler]] version, which might fail due to those new reserved words, FPC declared the
103-
104-``` pascal
105-&
106-```
107-
108-as an escape character. Thus, without refactoring the code but escaping, i.e. prepending an
109-
110-``` pascal
111-&
112-```
113-
114-to the [[Identifier|identifier]], the compiler accepts the actual reserved word as a valid identifier. New code though shall come up with different identifier names, without utilizing this feature.
42+[[FPC|FreePascal]] retroactively declared some new [[Reserved word|reserved words]]. In order of being capable of compiling old code with an up-to-date [[Compiler|compiler]] version, which might fail due to those new reserved words, FPC declared the `&` as an escape character. Thus, without refactoring the code but escaping, i.e. prepending an `&` to the [[Identifier|identifier]], the compiler accepts the actual reserved word as a valid identifier. New code though shall come up with different identifier names, without utilizing this feature.
11543
11644## Lazarus
11745
118-No [[Lazarus/pt|Lazarus]] o
119-
120-``` pascal
121-&
122-```
123-
124-é usado para
125-
126-- indicar teclas de atalho em \[\[TMenuItem\|
127- ``` pascal
128- TMenuItem
129- ```
46+No [[Lazarus/pt|Lazarus]] o `&` é usado para
13047
131- \]\]
48+- indicar teclas de atalho em [[TMenuItem]]
13249
13350---
13451*From the Free Pascal wiki, page "&/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).*

Back to history