default access modifier for a sub or a function when not set

  • Thread starter Thread starter Mark Kamoski
  • Start date Start date
M

Mark Kamoski

Hi--

Please help.

What is the default access modifier value for a Sub or a Function when one
has not explicitly been set.

In MSDN, in "Access Types", it states...

"If no access modifier has been specified, the default access type depends
on the declaration context"

....which, although interesting, is somewhat less than direct.

Let's suppose a simple case. There is an ASPX page as the UI and an ASPX.VB
page as the code-behind logic. Now, if someone opens that ASPX.VB file and
simply writes a method such as...

Sub DoSomething()

'...

End Sub

....what default access modifier is applied to this method?

Please advise.

Thank you.

--Mark
 
Hello,

Mark Kamoski said:
What is the default access modifier value for a Sub
or a Function when one has not explicitly been set. [...]
simply writes a method such as...

Sub DoSomething()

'...

End Sub

...what default access modifier is applied to this method?

\\\
Class Foo
Sub Bla()
End Sub
End Class
///

will declare Foo as Friend and Bla as Public. Open the object browser
to check the modifier. I always specify the modifier...

;-)

Regards,
Herfried K. Wagner
 
Back
Top