473,396 Members | 1,945 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Where can I put this string so it is visible to all programs?

I've looked for a 'module' and used the class viewer to put it in there,
but 'Public UserID As String' is still not a globally visible string.
How do I do this please?
Thanks,
Trint

.Net programmer
tr********@hotmail.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
9 992
"Trint Smith" <tr********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I've looked for a 'module' and used the class viewer to put it in there,
but 'Public UserID As String' is still not a globally visible string.
How do I do this please?
Thanks,
Trint


If you are writing a library, you would typically expose a string that is
gettable and settable via a property.

R.
Nov 20 '05 #2
Modules are a little weird in VB.NET, don't act like they did in vb6 (from
what I've seen, I try to avoid them like the plague).

Anyways, you might want to do

Imports myModule

on top of the classes you want to use it in. Personally, I would use a
Class declaration and call a shared varialble

i.e

public class myClass

public shared UserID as Integer

end class
"Trint Smith" <tr********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I've looked for a 'module' and used the class viewer to put it in there,
but 'Public UserID As String' is still not a globally visible string.
How do I do this please?
Thanks,
Trint

Net programmer
tr********@hotmail.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #3
* Trint Smith <tr********@hotmail.com> scripsit:
I've looked for a 'module' and used the class viewer to put it in there,
but 'Public UserID As String' is still not a globally visible string.


What exactly do you mean with "globally"?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
I figured it out...
In VS.NET right click on the project in the solution viewer and select
add> add new item> module> open>
It looks like this of course:

Module Module1

End Module

then just stick it in there so that it looks like this:

Module Module1
Public UserID As String
End Module

And anything can be seen by any program in the project.
Thanks,
Trint
.Net programmer
tr********@hotmail.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #5
Shared variable would be just what the guy is looking for, I agree.

"CJ Taylor" <no****@blowgoats.com> wrote in message
news:10*************@corp.supernews.com...
Modules are a little weird in VB.NET, don't act like they did in vb6 (from
what I've seen, I try to avoid them like the plague).

Anyways, you might want to do

Imports myModule

on top of the classes you want to use it in. Personally, I would use a
Class declaration and call a shared varialble

i.e

public class myClass

public shared UserID as Integer

end class
"Trint Smith" <tr********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I've looked for a 'module' and used the class viewer to put it in there,
but 'Public UserID As String' is still not a globally visible string.
How do I do this please?
Thanks,
Trint

Net programmer
tr********@hotmail.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 20 '05 #6
But I'll encrourage u to use Shared member variables for this purpose.

"Trint Smith" <tr********@hotmail.com> wrote in message
news:uv**************@TK2MSFTNGP10.phx.gbl...
I figured it out...
In VS.NET right click on the project in the solution viewer and select
add> add new item> module> open>
It looks like this of course:

Module Module1

End Module

then just stick it in there so that it looks like this:

Module Module1
Public UserID As String
End Module

And anything can be seen by any program in the project.
Thanks,
Trint
Net programmer
tr********@hotmail.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #7
* "Abubakar" <em**********@yahoo.com> scripsit:
But I'll encrourage u to use Shared member variables for this purpose.


.... in a class. Or you can implement the singleton design pattern...

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #8
I meant just make some class where he can keep all his shared stuff

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uE**************@TK2MSFTNGP09.phx.gbl...
* "Abubakar" <em**********@yahoo.com> scripsit:
But I'll encrourage u to use Shared member variables for this purpose.


... in a class. Or you can implement the singleton design pattern...

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #9
* "Abubakar" <em**********@yahoo.com> scripsit:
I meant just make some class where he can keep all his shared stuff


Yep... That will work too.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #10

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

Similar topics

0
by: Glenn Venzke | last post by:
I have several folders on a test web server that are not visible in the directory structures of several programs, including Visual Interdev and Stac ReachOut. All these folders have one thing in...
15
by: Lasse Skyum | last post by:
I have my own string class that I'm generally verry fond of compared to std::string. For that same reason I'm trying to improve a little on it. Since manny objects in my project will contain...
2
by: Web Team | last post by:
Hi All, I have this code, which I am trying not to replicate many times in my code-behind. Me.img1.Visible = False Me.img1UploadButton.Visible = True Me.pnlImg1Uploader.Visible = True...
3
by: Trint Smith | last post by:
I have several strings in my project that I want all programs in the project to be able to see...How do I do that? Thanks, Trint .Net programmer trintsmith@hotmail.com *** Sent via...
4
by: Trint Smith | last post by:
I did have UserID as 'Dim UserID As String'. Ok, when I made it 'Public UserID As String', in the Public Area of one program and took out all the 'local' declairations of it, even in the other...
16
by: Miguel Dias Moura | last post by:
Hello, i have 5 panels in an ASP.net / VB page. The panel 1 is visible the other 4 are NOT visible. I also have 5 images: image 1, image 2, ..., image5. When i click one of the images,...
43
by: Kislay | last post by:
Which of the following is correct regarding the storage of global variables : 1. Global variables exist in a memory area that exists from before the first reference in a program until after the...
4
by: 1230987za | last post by:
Hi, Let's say I have the following class: class foo { public: foo(); void addItem(int item); private:
5
by: sarabonn | last post by:
hallo, I have a function which takes 2 values as input and i want to return that 2 values, so how should write the return statement to return 2 values of String array. I also i should...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.