FBWiki : KeyPgOpAdd

FBWiki :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register

Operator + (Addition)


Sums two expressions

Syntax:


declare operator + ( byref lhs as T, byref rhs as integer ) as T
declare operator + ( byref lhs as integer, byref 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, Operator + (Add) concatenates the two strings and returns the result.

If either the left or right-hand side expressions is of Pointer type, Operator + (Add) performs pointer arithmetic on the address, returning the result.

Neither operand is modified in any way.

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

Examples:
Dim n As Single
n = 4.54 + 5.46
Print n
Sleep

will produce the output:

10


Dialect Differences:

Differences from QB:

See also:

Back to Arithmetic Operators
Back to Operators

There are no comments on this page. [Add comment]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.0



sf.net phatcode