This code is only meant to find the first occurance because
- It sets a flag as soon as it finds what your search for and uses that flag to halt the loop
- It uses a single variable, search, to store the found index which is also the loop counter so it can't store more than 1 result
To make if find multiple results then you need to
- Stop the loop using found as a stop condition
- Add a veritable, list or array, to store the results so there can be more than 1
- Change the output to use the results in the new variable