2021年3月19日星期五

visual basic .net Function have error return

So the error is BC42353 ( Function ValidateInputFields doesn't return a value on all code paths. Are you missing a Return statement? ) I'm getting this error twice. I put exclamation points on the lines that it says the errors are on.

Private Function CekBarcode(sID As String, cost As Long, price As Long, ByVal vslist As DataGridView) As Boolean      Dim i As Long      Try          For i = 1 To vslist.Rows.Count - 1              If sID = vslist.Rows(i - 1).Cells(1).Value Then                  '  CekBarcode = True                  vslist.Rows(i - 1).Cells(10).Value = vslist.Rows(i - 1).Cells(10).Value + 1                  Return True                  Exit For              Else                  Return False              End If          Next      Catch          Return False      End Try  End Function  
https://stackoverflow.com/questions/66702168/visual-basic-net-function-have-error-return March 19, 2021 at 11:32AM

没有评论:

发表评论