SortMBS methods

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

Back to SortMBS module.

Previous items

SortMBS.SumArrayMBS(source() as UInt64, sourceIndex as Integer = 0, sourceCount as Integer = -2, CheckOverflow as Boolean = false) as UInt64

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Sort MBS Util Plugin 24.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sums up all the numbers in the array.
Example
Const u = 99999
Dim v(u) As UInt64

For i As Integer = 0 To u
v(i) = i
Next

Dim m1 As Double = Microseconds
Dim sumPlugin As UInt64 = SumArrayMBS(v, False)
Dim m2 As Double = Microseconds
Dim sumPluginOverflowChecked As UInt64 = SumArrayMBS(v, True)
Dim m3 As Double = Microseconds
Dim sumXojo As UInt64
For i As Integer = 0 To u
sumXojo = sumXojo + v(i)
Next
Dim m4 As Double = Microseconds


Dim timePlugin As Double = m2-m1
Dim timePluginOverflowChecked As Double = m3-m2
Dim timeXojo As Double = m4-m3
// plugin is faster than Xojo code

Break

You can limit range by passing in a source index and source count.
If sourceCount is -2, we sum up whole array - sourceIndex.
Pass true for overflow check to detect overflows for each addition. Otherwise pass false for better performance.
Returns the sum of all values.

See also:

Previous items

The items on this page are in the following plugins: MBS Util Plugin.


💬 Ask a question or report a problem