Function doesn't return a value on all code paths Vb.net

后端 未结 1 817
野性不改
野性不改 2021-01-26 03:56

I\'m somewhat new to programming and I am having trouble just making this work. I\'m supposed to run this code using a delegate but I\'ve run into error after error. I\'m usin

相关标签:
1条回答
  • 2021-01-26 04:36

    Your Function Fn1 doesn't return anything.

    Functions by definition return something. If you want a method that doesn't return anything you should declare it Sub instead of Function

    Your function should also declare the data type is is returning:

    Public Function Concat(s1 As String, s2 As String) As String
        return s1 & s2
    End Function
    
    0 讨论(0)
提交回复
热议问题