Sign in Join
Wiki copytemporary

Plus/fi

English · Français · Suomi · Русский

+

Symboli + (joka lausutaan “plus”) käytetään:

ASCII:ssa merkkikoodin desimaalinen arvo 43 (tai heksadesimaalisena 2B ) määritellään olevan + (Plus-merkki).

pascal
program plusDemo(input, output, stderr);

var
    x: longint;
    g: set of (foo, bar);
    m: string;
begin
    // unary operator: positive sign
    x := +7;                    // x saa arvokseen positiivisen luvun 7
    x := +$100;                 // x saa arvokseen 256
                                // (dollarin merkki merkitsee heksadesimaaliesitystä luvulle)
    
    // addition
    x := 7 + 7;                 // x saa arvokseen 14
    x := 7 + 7 + 7 + 7 + 7 + 7; // x saa arvokseen 42
    
    // union of sets
    g := [foo] + [bar];         // g saa arvokseen [foo, bar]
    
    // merkkijonojen ja / tai merkkien yhteenliittäminen (FPC / Delphi-laajennus)
    m := 'Hello ' + 'world!';   // m saa arvokseen 'Hello world!'
end.

Katso myös


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.

Revision 2, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.