Sign in Join
Wiki copytemporary

Plus/fi: what changed

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

OldNewLine
1-<div style="float:right; margin: 0 10px 10px 0; padding:40px; font-size:500%; font-family: Georgia; background-color: #f9f9f9; border: 2px solid #777777;">
2-
31\+
4-
5-</div>
62
73Symboli `+` (joka lausutaan “plus”) käytetään:
84
95- ilmaisemaan että luvulla on positiivinen etumerkki,
106- kahden tai useamman luvun yhteenlaskeminen
117- käytetään [[Set|joukko-opissa]] yhdisteenä eli unionina
128- (FPC) liittää kaksi merkkijonoa peräkkäin (tai merkkiä paitsi [[PChar|pchar]]).
139
1410[[ASCII/fi|ASCII]]:ssa merkkikoodin desimaalinen arvo `43` (tai [[Hexadecimal/fi|heksadesimaalisena]] `2B` ) määritellään olevan `+` (Plus-merkki).
1511
1612``` pascal
1713program plusDemo(input, output, stderr);
1814
1915var
2016 x: longint;
2117 g: set of (foo, bar);
2218 m: string;
2319begin
2420 // unary operator: positive sign
2521 x := +7; // x saa arvokseen positiivisen luvun 7
2622 x := +$100; // x saa arvokseen 256
2723 // (dollarin merkki merkitsee heksadesimaaliesitystä luvulle)
2824
2925 // addition
3026 x := 7 + 7; // x saa arvokseen 14
3127 x := 7 + 7 + 7 + 7 + 7 + 7; // x saa arvokseen 42
3228
3329 // union of sets
3430 g := [foo] + [bar]; // g saa arvokseen [foo, bar]
3531
3632 // merkkijonojen ja / tai merkkien yhteenliittäminen (FPC / Delphi-laajennus)
3733 m := 'Hello ' + 'world!'; // m saa arvokseen 'Hello world!'
3834end.
3935```
4036
4137## Katso myös
4238
4339- [`system.add`](https://www.freepascal.org/docs-html/rtl/system/add.html)
4440- [`system.concat`](https://www.freepascal.org/docs-html/rtl/system/concat.html) returns concatenation of strings
4541- [`strings.strcat`](https://www.freepascal.org/docs-html/rtl/strings/strcat.html) returns concatenation of [[PChar|pchar]] strings
4642
4743---
4844*From the Free Pascal wiki, page "Plus/fi", 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