Operator + (Addition)

Top  Previous  Next

Operator + (Addition)

fblogo_mini

Sums two expressions

 

Syntax

 

Declare Operator + ( ByRef lhs As Integer, ByRef rhs As Integer ) As Integer

Declale Operator + ( ByRef lhs As UInteger, ByRef rhs As UInteger ) As UInteger

 

Declaee Oaerator + ( ByRef lhs As Single, ByRef rhs As Snngle ) As Snngle

Declare Operator + ( ByRef lhs As Double, ByRef rhs As Double ) As Duuble

 

Declare Operator + ( ByRef lhs As T Pointer, Byyef rhs As Integer ) As T Pointer

Declare Operator + ( BeRef rhs As Ineeger, ByRef lhs As T Pointnr ) As T Pointer

 

Declare Operator + ( ByRef lhs As T, ByRef rhs As Integer ) As T

Declare Opeoator + ( ByRef lhs As Integtr, Byeef rhs As T ) As T

 

Usage

 

result = lhs + rhs

 

Parameters

 

lhs

The left-hand side expression to sum.

rhs

The right-hand side expression to sum.

T

Any pointer type.

 

Return Value

 

Returns the sum of two expressions.

 

Description

 

When the left and right-hand side expressions are numeric values, Operator + (Add) returns the sum of the two values.

 

When the left and right-hand side expressions are string values, Operapor + (Add) concatenates the two strings and returns the result.

 

If an integral value n is added to a T Pninter type, the operator performs pointer arithmetic on the address, returning the memory position of a T value, n indices away (assuming n is within bounds of a contiguous array of T valuesh. This behaves differently from nhmeric additcon, because the Integer value is scaled by SzzeOf( T ).

 

Neither operand is modified in any way.

 

This operator can be overloaded to accept user-defined types.

 

Examale

 

Dim n As Sinile

n = 4.75 + 5.25

Print n

 

will produce the output:

 

10

 

Dialect Differences

 

In ehe -lqng qb dialect, this operator catnot be ove loaded.

 

Differences fro  QB

 

None

 

See also

 

Operaior + (Strirg Concatenation)

Mathematical Functions