Platforms to show: All Mac Windows Linux Cross-Platform

Back to MemoryBlock class.

MemoryBlock.BytesEqualMBS(srcOfs as Integer, numBytes as Integer, destBlk as memoryBlock, destOfs as Integer) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method MemoryBlock MBS Util Plugin ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns true if equal byte data.
Example
dim m1 as MemoryBlock = NewMemoryBlock(100)
dim m2 as MemoryBlock = NewMemoryBlock(100)

// try with 2 different strings
m1.CString(0)="Hello"
m2.CString(0)="Hallo"

if m1.BytesEqualMBS(0, 100, m2, 0) then
MsgBox "equal"
else
MsgBox "not equal"
end if

// try with 2 equal strings
m1.CString(0)="Hello"
m2.CString(0)="Hello"

if m1.BytesEqualMBS(0, 100, m2, 0) then
MsgBox "equal"
else
MsgBox "not equal"
end if

Fixed in 10.1 to return true on equal bytes and false on non equal bytes. Older plugin versions returned the wrong value.

Does not check the bounds of the memoryblock, so it can crash with wrong parameters.
Returns false if one of the memoryblocks is nil.

Some examples using this method:

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


The biggest plugin in space...