Seems the Byte-option gets ignored completely if the Ptr-option is used, test below proves that Byte-option works quite well on other data
Uses "console"
Type some_Data
pType As DWord
pName As DWord
Index As Long
End Type
Dim foo(5) As some_data
Long i
' fill in some data
For i = 1 To UBound(foo)
foo(i).pType = i * 100
foo(i).pName = i * 200
foo(i).Index = i
Next
Dim toFind As some_Data
toFind.pName = 600
toFind.Index = 3
' search for byte 5 to 12 only, should print 3:
PrintL "expect 3, found " & Str$( Array Scan foo, Byte(5, 8), = toFind )
' search for whole data, should print 0
PrintL "expect 0, found " & Str$( Array Scan foo, = toFind )
' now make the type match
toFind.pType = 300
' search for byte 5 to 12 only, should print 3:
PrintL "expect 3, found " & Str$( Array Scan foo, Byte(5, 8), = toFind )
' search for whole data, should print 3
PrintL "expect 3, found " & Str$( Array Scan foo, = toFind )
WaitKey
Bookmarks