472,119 Members | 1,360 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

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 5502
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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.