get next object in list that is red

BlitzMax Forums/BlitzMax Beginners Area/get next object in list that is red

if i had a list of ships
how would I get the next one in the list that had a colour field of "red"

also if the one I have selected is the last red one on the list

how do I get the first red one on the list ?

e.g.
type ship
global list
field colour$
endtype