SelectDevices(list, ship, condition);
It searches only between the given devices of the ’ship’ (S.device & S.owner=ship & condition). Its return value is the number of elements.