开发者

ASP.net - Does a return statement in function stop the function?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜