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.
精彩评论