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 开发者_Python百科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?
That is correct.
See Function Statement.
Returns control to the code that called a Function, Sub, Get, Set, or Operator procedure.
精彩评论