开发者

Function without return type

In my project (which I inherited from someone) there are a lot of functions like:

Public Function DoSomething(ByVal s As String)
    ' Do something to public properties
End Function

And they are called like this:

DoSomething(s)

So the return value is ignored (which is object, as I see in the docs). Is it safe to change al开发者_JAVA百科l these functions to Subs? Could I break something which isn't so obvious?


Should be safe. That's what Subs are for, this is really bad style by your predecessor.


Is there any specific reason you want to convert to Subs? From your code the Function has no return type - in this situation I can't see there being any problem.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜