473,480 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Why use Dim outside of sub?

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
Nov 21 '05 #1
2 1322
I'm pretty sure there is no difference and they just allow either. Both
would be module level scoped variables and private.

HTH,

Shane

"Brett" <no@spam.com> wrote in message
news:um**************@TK2MSFTNGP14.phx.gbl...
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

Nov 21 '05 #2
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
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2265
by: | last post by:
In global.asa I have some code outside all the Subs. I have some confirmation that it is being executed OnStart. Yet I can's see if it is executed OnEnd. The literature I have says that OnEnd...
2
2778
by: Rajesh Kapur | last post by:
Hello, We use Informix and MySQL on linux/unix to drive our web application. SQL*Server is used only for backend enterprise applications within the firewall. I am trying to get the management to...
1
1991
by: Markus | last post by:
Hi, I am trying to query the value of a textfield outside of a form but with no success so far... the reason why I am not using a form is that there seams to be an annoying issue with hitting...
20
7873
by: Mandy Memphis | last post by:
If I perform a mousedown within a document, move the mouse outside the browser window, and then release the mouse button, the document.onmouseup event does not fire. Is there any way to detect a...
3
14127
by: Jason | last post by:
I'm trying to implement some pretty basic behavior in c#/.net 1.1 Forms but can't seem to find all the requisite pieces. When a user clicks on the background of the form, I want the app to start...
2
1189
by: Oleg | last post by:
I need to configure my web application to see a folder outside it's root. I know I need to configure my web.config file, but don't know how. Can you help?
3
3846
by: George | last post by:
Hi, I have searched on the net quite a bit, but the more I read, the more confused I get. I want to see if I can raise an event out side of the class. I believe this can be done in VB (at...
11
1698
by: utab | last post by:
Dear all, in a class definition class X{ private: static map< string , map<string, int word_map; static void initialize(); };
3
1657
by: mehdi | last post by:
Hi folks, Consider a visual component that's being derived from Control, say MyCustomControl. This is opened-up whenever the user clicks a given button in the toolbar. How am I supposed to open up...
2
3735
by: xx75vulcan | last post by:
Howdy, I have successfully setup my php.ini file on a web server to communicate with my Microsoft Exchange Mail server, and can test the ability to send mail using the mail() function to...
0
7052
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7092
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6744
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4790
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4488
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3000
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1304
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
565
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
188
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.