Using Filter(...) function

Using Filter(...) function

Anonymous
Not applicable
263 Views
1 Reply
Message 1 of 2

Using Filter(...) function

Anonymous
Not applicable
I am trying to determine if I am getting anything returned from my
filter function. How do you test an array to see if there is anything
there?

Here is an example

dim ResultingArray as Variant

ResultingArray = Filter(PieceMarkArray, UCase(PartProps.PositionNumber),
True, vbBinaryCompare)

IsEmpty() and IsNull() doesn't seem to recognize when there is nothing
returned.
0 Likes
264 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Hi Bill,
Try the following, just ignore the fact that the variant in the function
is named point:

Public Function IsEmpty(Point As Variant) As Boolean
Dim testpt
On Error Resume Next
testpt = Point
If Err Then
Err.Clear
IsEmpty = True
End If
End Function

You can also just attempt to access the first element (0) and if an
error is returned, it's empty.
-Josh

Bill Wright wrote:

> I am trying to determine if I am getting anything returned from my
> filter function. How do you test an array to see if there is anything
> there?
>
> Here is an example
>
> dim ResultingArray as Variant
>
> ResultingArray = Filter(PieceMarkArray, UCase(PartProps.PositionNumber),
> True, vbBinaryCompare)
>
> IsEmpty() and IsNull() doesn't seem to recognize when there is nothing
> returned.
>
>
0 Likes