Plus/fi: 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 | Symboli `+` (joka lausutaan “plus”) käytetään: | |
| 8 | 4 | ||
| 9 | 5 | - ilmaisemaan että luvulla on positiivinen etumerkki, | |
| 10 | 6 | - kahden tai useamman luvun yhteenlaskeminen | |
| 11 | 7 | - käytetään [[Set|joukko-opissa]] yhdisteenä eli unionina | |
| 12 | 8 | - (FPC) liittää kaksi merkkijonoa peräkkäin (tai merkkiä paitsi [[PChar|pchar]]). | |
| 13 | 9 | ||
| 14 | 10 | [[ASCII/fi|ASCII]]:ssa merkkikoodin desimaalinen arvo `43` (tai [[Hexadecimal/fi|heksadesimaalisena]] `2B` ) määritellään olevan `+` (Plus-merkki). | |
| 15 | 11 | ||
| 16 | 12 | ``` pascal | |
| 17 | 13 | program plusDemo(input, output, stderr); | |
| 18 | 14 | ||
| 19 | 15 | var | |
| 20 | 16 | x: longint; | |
| 21 | 17 | g: set of (foo, bar); | |
| 22 | 18 | m: string; | |
| 23 | 19 | begin | |
| 24 | 20 | // unary operator: positive sign | |
| 25 | 21 | x := +7; // x saa arvokseen positiivisen luvun 7 | |
| 26 | 22 | x := +$100; // x saa arvokseen 256 | |
| 27 | 23 | // (dollarin merkki merkitsee heksadesimaaliesitystä luvulle) | |
| 28 | 24 | ||
| 29 | 25 | // addition | |
| 30 | 26 | x := 7 + 7; // x saa arvokseen 14 | |
| 31 | 27 | x := 7 + 7 + 7 + 7 + 7 + 7; // x saa arvokseen 42 | |
| 32 | 28 | ||
| 33 | 29 | // union of sets | |
| 34 | 30 | g := [foo] + [bar]; // g saa arvokseen [foo, bar] | |
| 35 | 31 | ||
| 36 | 32 | // merkkijonojen ja / tai merkkien yhteenliittäminen (FPC / Delphi-laajennus) | |
| 37 | 33 | m := 'Hello ' + 'world!'; // m saa arvokseen 'Hello world!' | |
| 38 | 34 | end. | |
| 39 | 35 | ``` | |
| 40 | 36 | ||
| 41 | 37 | ## Katso myös | |
| 42 | 38 | ||
| 43 | 39 | - [`system.add`](https://www.freepascal.org/docs-html/rtl/system/add.html) | |
| 44 | 40 | - [`system.concat`](https://www.freepascal.org/docs-html/rtl/system/concat.html) returns concatenation of strings | |
| 45 | 41 | - [`strings.strcat`](https://www.freepascal.org/docs-html/rtl/strings/strcat.html) returns concatenation of [[PChar|pchar]] strings | |
| 46 | 42 | ||
| 47 | 43 | --- | |
| 48 | 44 | *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).* |
