Add8 Operator and Function

Purpose

Adds a numeric expression to a numeric variable of type Large.

Syntax

l = x Add8 y( operator)

l = Add8(i, j[,m,...])( function)

x:Large numeric variable
y:any numeric expression
i, j, m, l:Large integer expression

Description

The operator i Add8 j and function Add8(i, j, …) return the sum of 64-bit integer expressions. In case one of the parameters isn't a Large, it is converted to 64-bit values first (using CLarge).

Note There is no 64-bit version of the Add command to add an expression to a variable, because Add is type independent and works with Large types as well.

Example

Debug.Show

Dim b# = 1.5, i64 As Large

Trace b# Add8 3         // CInt(b#) + 3 = 5

Trace Add8(b#, 3)       // CInt(b#) + 3 = 5

Add i64, 3 : Trace i64  // b# = 3

b# = 2.5

Trace b# Add8 3         // CInt(b#) + 3 = 5

Trace Add8(b#, 3)        // CInt(b#) + 3 = 5

Remarks

Although Add can be used with any numeric variable, the usage of integer variables is recommended in order to achieve the maximum optimization for speed.

Instead of Add x, y, you can use x = x + y, x := x + y, or x += y. When using integer variables Add doesn't test for overflow!

See Also

Add8, Sub8, Mul8, Div8, Mod8

{Created by Sjouke Hamstra; Last updated: 23/09/2014 by James Gaite}