2010-06-08 51 views
1

鑑於功能ASP.net - 函數中的return語句是否停止函數?

'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 

當「返回false」被激發,我假設功能停止在這一點上,有沒有必要退出維權之類的東西?

回答

1

這是正確的。

請參閱Function Statement

控制權返回給 調用的函數,子,獲取的代碼,設置或 操作過程。

相關問題