Plus

This is an old revision of Plus, edited by Djzepi at . The current revision is 118076.

+

The symbol + (pronounced “plus”) is used to:

In ASCII, the character code decimal 43 (or hexadecimal 2B) is defined to be + ( Plus sign ).

program plusDemo(input, output, stderr);

var
    x: longint;
    g: set of (foo, bar);
    m: string;
begin
    // unary operator: positive sign
    x := +7;                    // x becomes positive 7
    x := +$100;                 // x becomes 256
                                // (dollar sign denotes hexadecimal base)
    
    // addition
    x := 7 + 7;                 // x becomes 14
    x := 7 + 7 + 7 + 7 + 7 + 7; // x becomes 42
    
    // union of sets
    g := [foo] + [bar];         // g becomes [foo, bar]
    
    // concatenation of strings and/or characters (FPC/Delphi extension)
    m := 'Hello ' + 'world!';   // m becomes 'Hello world!'
end.

see also

navigation bar: topic: Pascal symbols
single characters + (plus)  •  - (minus)  •  * (asterisk)  •  / (slash) = (equal)  •  > (greater than)  •  < (less than) . (period)  •  : (colon)  •  ; (semi colon) ^ (hat)  •  @ (at) $ (dollar sign)  •  & (ampersand)  •  # (hash) ' (single quote)
character pairs

<> (not equal)  •  <= (less than or equal)  •  := (becomes)  •  >= (greater than or equal)

 •  >< (symmetric difference)  • 

// (double slash)