M.....
This thinking is different from my original thought.
I expect minerr() has its bulit-in algorithm to automatically choose the next variable set in each loop.
Therefore, the concept of the code design is to call variables from the table into the minerr() and then let minerr() does it work.
But you are talking about the variable choosing in each loop using IF statement.
Do you mean that there is no way to do my concept using minerr()?