views:

36

answers:

1

Given the function

'Returns true if no cell is > 1
Function isSolutionValid() As Boolean
    Dim rLoop As Integer
    Dim cLoop As Integer
    For cLoop = 0 To canvasCols - 1
        For rLoop = 0 To canvasRows - 1
            If canvas(cLoop, rLoop) > 1 Then
                Return False
            End If
        Next
    Next
    Return True
End Function

When 'return false' is fired, I'm assuming that the function is stopped at that point and there's no need for exit fors and things like that?

+1  A: 

That is correct.

See Function Statement.

Returns control to the code that called a Function, Sub, Get, Set, or Operator procedure.

RedFilter