469,344 Members | 6,413 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,344 developers. It's quick & easy.

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



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

Nov 19 '05 #1
1 5431
Hello,

"Mark Kamoski" <mk******@yahoo.com> schrieb:
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
--
MVP VB Classic, VB .NET
http://www.mvps.org/dotnet
Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Dan Disney | last post: by
3 posts views Thread by N Khan via .NET 247 | last post: by
1 post views Thread by Jacob N. Rohde | last post: by
3 posts views Thread by Mr Newbie | last post: by
5 posts views Thread by Harold Hsu | last post: by
11 posts views Thread by prefersgolfing | last post: by
6 posts views Thread by Tony Johansson | last post: by
1 post views Thread by Richard Coltrane | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.