According to the docs, PB9 should be able to scan arrays of UDTs:
So why doesn't this work?
ARRAY SCAN cannot be used on arrays within UDT structures. However, ARRAY SCAN can be used with arrays of UDT structures - simply treat them as if they were an array of fixed-length strings.
Code:
#Compile Exe #Dim All TYPE TESTUDT sName as string * 15 sAddr AS STRING * 15 sJunk AS STRING * 15 END TYPE Function PBMain() Local iCount as long Local iFound as long Local sFind as STRING Local uList() as TESTUDT REDIM uList(1 to 5) For iCount = 1 to 5 uList(iCount).sName = "TestName" & format$(iCount) uList(iCount).sAddr = "TestAddr" & format$(iCount) uList(iCount).sJunk = "TestJunk" & format$(iCount) NEXT iCount sFind = uList(3).sAddr ARRAY SCAN uList(), COLLATE UCASE, =UCASE$(sFind), TO iFound Msgbox "ARRAY SCAN returned: " & str$(iFound),,uList(3).sAddr & " found at:" Msgbox sFind,, uList(3).sAddr END FUNCTION
Comment