开发者

Function without return type

开发者 https://www.devze.com 2023-01-31 18:32 出处:网络
In my project (which I inherited from someone) there are a lot of functions like: Public Function DoSomething(ByVal s As String)

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

精彩评论

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