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
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) = iNext Dim m1 As Double = MicrosecondsDim sumPlugin As UInt64 = SumArrayMBS(v, False )Dim m2 As Double = MicrosecondsDim sumPluginOverflowChecked As UInt64 = SumArrayMBS(v, True )Dim m3 As Double = MicrosecondsDim sumXojo As UInt64 For i As Integer = 0 To u sumXojo = sumXojo + v(i)Next Dim m4 As Double = MicrosecondsDim timePlugin As Double = m2-m1Dim timePluginOverflowChecked As Double = m3-m2Dim 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:
SumArrayMBS(source() as Boolean, sourceIndex as Integer = 0, sourceCount as Integer = -2) as Int64
SumArrayMBS(source() as Currency, sourceIndex as Integer = 0, sourceCount as Integer = -2, CheckOverflow as Boolean = false) as Currency
SumArrayMBS(source() as Double, sourceIndex as Integer = 0, sourceCount as Integer = -2) as Double
SumArrayMBS(source() as Int32, sourceIndex as Integer = 0, sourceCount as Integer = -2) as Int64
SumArrayMBS(source() as Int64, sourceIndex as Integer = 0, sourceCount as Integer = -2, CheckOverflow as Boolean = false) as Int64
SumArrayMBS(source() as Single, sourceIndex as Integer = 0, sourceCount as Integer = -2) as Double
SumArrayMBS(source() as UInt32, sourceIndex as Integer = 0, sourceCount as Integer = -2, CheckOverflow as Boolean = false) as UInt64
Previous items
The items on this page are in the following plugins: MBS Util Plugin .