Question Enforcing an accessibility/scope modifier in procedure declarations

Keith Howard

Active member
Joined
Jan 28, 2010
Messages
28
Programming Experience
5-10
Hello,

I'd like "Bad" not to compile and "Good" to compile. Is there a switch or a way to enforce this? (It's a bit like Option Strict.)

Bad
Sub ProcedureName()
End Sub

Good
Public Sub ProcedureName()
End Sub

Many thanks,

Keith
 
No there isn't. You can't prevent it compiling but you can use a code analysis tool to detect bad coding practices and flag them. StyleCop is one such tool but I believe that it only works with C#. You may be able to find something similar for VB.
 
Many thanks. That's what I thought.
Happy holidays.
Keith
P.S. If anyone knows of an appropriate tool for VB, a referral would be appreciated.
 
Back
Top