Platforms to show: All Mac Windows Linux Cross-Platform

Back to SortMBS module.

Previous items Next items

SortMBS.EqualsMBS(extends array1() as Int64, array2() as Int64, array1offset as Integer = 0, count as Integer = -2, array2offset as Integer = 0) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Sort MBS Util Plugin 24.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Compares the content of one array to another array.
Example
Const u = 99999

Var v1(u) As Integer
Var v2(u) As Integer

For i As Integer = 0 To u
v1(i) = i
v2(i) = i
Next

// should be equal
Var b1 As Boolean = v1.EqualsMBS(v2)

v1(123) = 0

// should not be equal
Var b2 As Boolean = v1.EqualsMBS(v2)

// should be equal
Var b3 As Boolean = v1.EqualsMBS(v2, 200, -2, 200)
Var b4 As Boolean = v1.EqualsMBS(v2, 0, 100, 0)

// and this should be false
Var b5 As Boolean = v1.EqualsMBS(v2, 0, 200, 0)
Var b6 As Boolean = v1.EqualsMBS(v2, 1) // <- offet one in first array

Break

Returns true if they are equal in the given range.

SourceCount can be -2 to use array count - sourceIndex.
destIndex lets you pick where to start in the destination array.

Performs bounds checking and may raise an OutOfBoundsException.

See also:

SortMBS.EqualsMBS(extends array1() as Ptr, array2() as Ptr, array1offset as Integer = 0, count as Integer = -2, array2offset as Integer = 0) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Sort MBS Util Plugin 24.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Compares the content of one array to another array.

Returns true if they are equal in the given range.

SourceCount can be -2 to use array count - sourceIndex.
destIndex lets you pick where to start in the destination array.

Performs bounds checking and may raise an OutOfBoundsException.

See also:

SortMBS.EqualsMBS(extends array1() as Single, array2() as Single, array1offset as Integer = 0, count as Integer = -2, array2offset as Integer = 0) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Sort MBS Util Plugin 24.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Compares the content of one array to another array.

Returns true if they are equal in the given range.

SourceCount can be -2 to use array count - sourceIndex.
destIndex lets you pick where to start in the destination array.

Performs bounds checking and may raise an OutOfBoundsException.

See also:

SortMBS.EqualsMBS(extends array1() as String, array2() as String, array1offset as Integer = 0, count as Integer = -2, array2offset as Integer = 0) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Sort MBS Util Plugin 24.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Compares the content of one array to another array.

Returns true if they are equal in the given range.

SourceCount can be -2 to use array count - sourceIndex.
destIndex lets you pick where to start in the destination array.

Performs bounds checking and may raise an OutOfBoundsException.

See also:

SortMBS.EqualsMBS(extends array1() as UInt32, array2() as UInt32, array1offset as Integer = 0, count as Integer = -2, array2offset as Integer = 0) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Sort MBS Util Plugin 24.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Compares the content of one array to another array.

Returns true if they are equal in the given range.

SourceCount can be -2 to use array count - sourceIndex.
destIndex lets you pick where to start in the destination array.

Performs bounds checking and may raise an OutOfBoundsException.

See also:

SortMBS.EqualsMBS(extends array1() as UInt64, array2() as UInt64, array1offset as Integer = 0, count as Integer = -2, array2offset as Integer = 0) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Sort MBS Util Plugin 24.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Compares the content of one array to another array.

Returns true if they are equal in the given range.

SourceCount can be -2 to use array count - sourceIndex.
destIndex lets you pick where to start in the destination array.

Performs bounds checking and may raise an OutOfBoundsException.

See also:

SortMBS.SortArrayMBS(theArray() as DateTime, descending as boolean = false)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Sort MBS Util Plugin 24.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sorts a DateTime array.
Example
Var test() As DateTime
test.Append DateTime.Now
test.Append DateTime.FromString("2011-04-24")
test.Append DateTime.FromString("2022-03-21")
test.Append DateTime.FromString("2033-10-10")

SortArrayMBS test

Break // see in debugger

// now reverse it
SortArrayMBS test, True

Break // see in debugger

Does nothing for arrays with theArray.count < 2.
Pass true for descending to reverse the order.

See also:

SortMBS.SortArrayMBS(theArray() as Int64, theDelegate as SortVariantDelegateInt64MBS, descending as boolean = false)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Sort MBS Util Plugin 24.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sorts an Int64 array using a delegate to compare.
Example
Public Function CompareNumber(v1 as Integer, v2 as Integer) As integer
// we compare the absolute values, so 3 and -3 are next to each other in the result
v1 = Abs(v1)
v2 = Abs(v2)

If v1 = v2 Then
Return 0
ElseIf v1 < v2 Then
Return -1
Else
Return 1
End If
End Function

Sub Test
Var testInteger() As Integer = Array(1,3,6,1,2,-3,0,9)
SortArrayMBS testInteger, AddressOf CompareNumber

Break // see in debugger
End Sub

Does nothing for arrays with theArray.count < 2.
Pass true for descending to reverse the order.

Your delegate should be fast and return 0 if both values are equal, 1 if first value is bigger or -1 if first value is smaller.

See also:

SortMBS.SortArrayMBS(theArray() as Ptr, theDelegate as SortVariantDelegatePtrMBS, descending as boolean = false)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Sort MBS Util Plugin 24.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sorts a Ptr array using a delegate to compare.

Does nothing for arrays with theArray.count < 2.
Pass true for descending to reverse the order.

Your delegate should be fast and return 0 if both values are equal, 1 if first value is bigger or -1 if first value is smaller.

See also:

Previous items Next items

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


The biggest plugin in space...