代码之家  ›  专栏  ›  技术社区  ›  Tom Gullen

ASP.NET-函数中的RETURN语句是否停止该函数?

  •  1
  • Tom Gullen  · 技术社区  · 14 年前

    给定函数

    '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
    

    当“return false”被激发时,我假设函数在该点停止,并且不需要退出for s之类的东西?

    1 回复  |  直到 14 年前
        1
  •  1
  •   D'Arcy Rittich    14 年前

    没错。

    Function Statement .

    将控件返回到 调用函数、Sub、Get、Set或 操作程序。