Can you create a stored proc...that would make life easier.
If you can't, how I would use the shared array would be to create 2 arrays. 1 for fruits and one for the total count of that fruit. This way you can search the first for array for the fruit you want, and use its index to find the value in the second.
Not as simple as I would like, but when you are limited to 1 dimensional arrays it's the best you can do.
You would probably want to have the ability to grow the array (unless you know the max number of fruits) in which case I would look at help for REDIM an array...PRESERVE will probably good a friend, since you don't the existing values erased when you increase the size of the array.
HTH