471,310 Members | 1,223 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

GlobalMultiuse?

How can I make an item accessible to all areas of my assembly? For instance
say I have a string constant called sProgramName that I set to be "My
Program" located in a class called CConstants. How can I make this string
accessible to all classes within my assembly without 1) having to
instantiate a class or 2) reference the class (eg I want to just reference
sProgramName not CConstants.sProgramName)?

Thanks

Alan
Dec 20 '05 #1
1 1682
Alan,
How can I make this string
accessible to all classes within my assembly without 1) having to
instantiate a class
Constants are implicitly static so you never need to instantiate the class
to access it. Just make sure the constant is public or internal so other
classes can reference it.

2) reference the class (eg I want to just reference sProgramName not CConstants.sProgramName)?


That you can't do.
Mattias

Dec 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

15 posts views Thread by Mark Sisson | last post: by
3 posts views Thread by Neil Stevens | last post: by
1 post views Thread by Steve | last post: by
3 posts views Thread by Gonçalo Boléo | last post: by
1 post views Thread by viveka | last post: by
reply views Thread by rosydwin | 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.