Bug? No warnings for unused routine (not a real bug)

LucaMs

Expert
Licensed User
Longtime User
If you have an unused public routine named MyRoutine in a code module and a routine with the same name elsewhere (in a class module, in my project), you do not receive a warning that the (module) routine is not used.

F7 on the name of the (module) routine does not list references (rightly).
 

LucaMs

Expert
Licensed User
Longtime User
You might be writing a library or a module that will be reused by others. So it is expected that some of the public subs will not be used.

Yes, this is right and logical.

If you explicitly declare a sub to be public then the warning engine will not warn about it.

I had not noticed this.
I prefer to always declare explicitly the scope of routines.
On the other hand, a routine declared using only "Sub" in a public module is considered Public by default, so I thought that it would still have been signaled by the warning.


Thank you


[I would oblige the developer to explicitly declare the scope]
 
Top