Sign in Join
Wiki copytemporary

Plus: what changed

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

OldNewLine
1-\+
1++
22
3-The symbol `+` (pronounced “plus”) is used to:
3+The symbol `+` (pronounced “plus”) is used to:
44
5-- explicitly indicate the positive sign of a number,
6-- add two numbers resulting to a number,
7-- form a union of [[Set|sets]],
8-- (FPC) concatenate two strings (or characters; except [[PChar|pchar]]).
9-- if `{$modeSwitch arrayOperators+}` (default in [[Mode Delphi|{$mode Delphi}]]), concatenate arrays (since FPC 3.2.0)
10-- enable a feature in a `{$modeSwitch}`
5+ * explicitly indicate the positive sign of a number,
6+ * add two numbers resulting to a number,
7+ * form a union of [[Set|sets]],
8+ * (FPC) concatenate two strings (or characters; except [[PChar|`pchar`]]).
9+ * if `{$modeSwitch arrayOperators+}` (default in [[Mode Delphi|`{$mode Delphi}`]]), concatenate arrays (since FPC 3.2.0)
10+ * enable a feature in a `{$modeSwitch}`
1111
12-``` pascal
12+```
1313program plusDemo(input, output, stderr);
14-
15-var
16- x: longint;
17- g: set of (foo, bar);
18- m: string;
19-begin
20- // unary operator: positive sign
21- x := +7; // x becomes positive 7
22- x := +$100; // x becomes 256
23- // (dollar sign denotes hexadecimal base)
2414
25- // addition
26- x := 7 + 7; // x becomes 14
27- x := 7 + 7 + 7 + 7 + 7 + 7; // x becomes 42
28-
29- // union of sets
30- g := [foo] + [bar]; // g becomes [foo, bar]
31-
32- // concatenation of strings and/or characters (FPC/Delphi extension)
33- m := 'Hello ' + 'world!'; // m becomes 'Hello world!'
34-end.
15+ var
16+ x: longint;
17+ g: set of (foo, bar);
18+ m: string;
19+ begin
20+ // unary operator: positive sign
21+ x := +7; // x becomes positive 7
22+ x := +$100; // x becomes 256
23+ // (dollar sign denotes hexadecimal base)
24+
25+ // addition
26+ x := 7 + 7; // x becomes 14
27+ x := 7 + 7 + 7 + 7 + 7 + 7; // x becomes 42
28+
29+ // union of sets
30+ g := [foo] + [bar]; // g becomes [foo, bar]
31+
32+ // concatenation of strings and/or characters (FPC/Delphi extension)
33+ m := 'Hello ' + 'world!'; // m becomes 'Hello world!'
34+ end.
3535```
3636
37-The plus sign is also a unary operator. One can write such stupid expressions as `++++++++++++++42` which will evaluate to positive 42.
37+The plus sign is also a unary operator. One can write such stupid expressions as `++++++++++++++42` which will evaluate to positive 42.
3838
39-In [[ASCII]], the character code decimal `43` (or [[Hexadecimal|hexadecimal]] `2B`) is defined to be `+` (plus sign).
39+In [[ASCII]], the character code decimal `43` (or [[Hexadecimal|hexadecimal]] `2B`) is defined to be `+` (plus sign).
4040
4141## see also
4242
43-- [`system.add`](https://www.freepascal.org/docs-html/rtl/system/.op-add-variant-ariant-ariant.html)
44-- [`system.concat`](https://www.freepascal.org/docs-html/rtl/system/concat.html) returns concatenation of strings
45-- [`strings.strcat`](https://www.freepascal.org/docs-html/rtl/strings/strcat.html) returns concatenation of [[PChar|pchar]] strings
43+ * [`system.add`](<https://www.freepascal.org/docs-html/rtl/system/.op-add-variant-ariant-ariant.html>)
44+ * [`system.concat`](<https://www.freepascal.org/docs-html/rtl/system/concat.html>) returns concatenation of strings
45+ * [`strings.strcat`](<https://www.freepascal.org/docs-html/rtl/strings/strcat.html>) returns concatenation of [[PChar|`pchar`]] strings
4646
47+
48+
49+**navigation bar: topic: Pascal symbols**
50+
51+_single characters:_ `+` (plus) • [[Minus|`-` (minus)]] • [[*|`*` (asterisk)]] • [[Slash|`/` (slash)]] • [[Equal|`=` (equal)]] • [[Greater than|`>` (greater than)]] • [[Less than|`<` (less than)]] • [[period|`.` (period)]] • [[Colon|`:` (colon)]] • [[;|`;` (semi colon)]] • [[^|`^` (hat)]] • [[@|`@` (at)]] • [[Dollar sign|`$` (dollar sign)]] • [[&|`&` (ampersand)]] • [[Hash|`#` (hash)]] • [['|`'` (single quote)]]
52+
53+_character pairs:_ [[Not equal|`<>` (not equal)]] • [[Less than or equal|`<=` (less than or equal)]] • [[Becomes|`:=` (becomes)]] • [[Greater than or equal|`>=` (greater than or equal)]] • [[symmetric difference|`><` (symmetric difference)]] • [[Slash|`//` (double slash)]]
54+
4755---
48-*From the Free Pascal wiki, page "Plus", as it stood on 2019-10-16 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).*
56+*From the Free Pascal wiki, page "Plus", as the Internet Archive kept it on 2024-09-20, last changed on 2019-10-17. 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