code: def moveToNextRow(vs, func, reverse=False):
      'Move cursor to next (prev if reverse) row for which func returns True.  Returns False if no row meets the criteria.'
      rng = range(vs.cursorRowIndex-1, -1, -1) if reverse else range(vs.cursorRowIndex+1, vs.nRows)
  
      for i in rng:
          try:
              if func(vs.rows[i]):
                  vs.cursorRowIndex = i
                  return True
          except Exception:
              pass
  
      return Falsf moveToNextRow(vs, func, reverse=False):
      'Move cursor to next (prev if reverse) row for which func returns True.  Returns False if no row meets the criteria.'
      rng = range(vs.cursorRowIndex-1, -1, -1) if reverse else range(vs.cursorRowIndex+1, vs.nRows)
  
      for i in rng:
          try:
              if func(vs.rows[i]):
                  vs.cursorRowIndex = i
                  return True
          except Exception:
              pass
  
      return False
docs: Move cursor to next (prev if reverse) row for which func returns True.  Returns False if no row meets the criteria.