Why use Dim outside of sub?

B

Brett

What is the difference in:

Public Class Form1
Inherits System.Windows.Forms.Form
Dim myUrl As String

and
Private myUrl As String

In other words, using Dim or Private outside of a sub. Both can be seen
within any sub in that class.. Private seems more explicit. I'm also
assuming that Dim keeps the variable scoped only within that class, just
like Private.

Thanks,
Brett
 
S

Shane Story

I'm pretty sure there is no difference and they just allow either. Both
would be module level scoped variables and private.

HTH,

Shane
 
C

Cor Ligthert

Brett,
Public Class Form1
Inherits System.Windows.Forms.Form
Dim myUrl As String

and
Private myUrl As String

A mather of personal preference they are in this case both private inside
the class

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top