Hi,
I need to create some code that is always available, independently from where I am in the code (constants, global methods, etc.). I know that in VB6 one can create a module, which contains constants, global methods, etc.
What is the equivalent in C# / OOP?
Thanks.
Mike 4 1679
Mike wrote: Hi,
I need to create some code that is always available, independently from where I am in the code (constants, global methods, etc.). I know that in VB6 one can create a module, which contains constants, global methods, etc.
What is the equivalent in C# / OOP?
Thanks. Mike
Just add your own class or classes and add properties and methods to them.
--
incognito @ http://kentpsychedelic.blogspot.com/
Hi,
Have your global members (constants, methods, etc) as public/static in a class (say, Global) of your app. Then use them as Global.<member> from other places.
HTH.
"Mike" <no****@nospam.com> wrote in message news:#o**************@TK2MSFTNGP09.phx.gbl...
Hi,
I need to create some code that is always available, independently from where I am in the code (constants, global methods, etc.). I know that in VB6 one can create a module, which contains constants, global methods, etc.
What is the equivalent in C# / OOP?
Thanks.
Mike
Thanks!
"Shiva" <sh******@online.excite.com> wrote in message news:e7**************@TK2MSFTNGP11.phx.gbl...
Hi,
Have your global members (constants, methods, etc) as public/static in a class (say, Global) of your app. Then use them as Global.<member> from other places.
HTH.
"Mike" <no****@nospam.com> wrote in message news:#o**************@TK2MSFTNGP09.phx.gbl...
Hi,
I need to create some code that is always available, independently from where I am in the code (constants, global methods, etc.). I know that in VB6 one can create a module, which contains constants, global methods, etc.
What is the equivalent in C# / OOP?
Thanks.
Mike
You can add a class with static properties and static methods.
i.e.
class Globals
{
public const int MYVALUE = 3;
public static void GlobalHelperMethod()
{
// ...
}
}
--
Scott http://www.OdeToCode.com
On Sun, 18 Jul 2004 08:05:32 +0200, "Mike" <no****@nospam.com> wrote: Hi,
I need to create some code that is always available, independently from where I am in the code (constants, global methods, etc.). I know that in VB6 one can create a module, which contains constants, global methods, etc.
What is the equivalent in C# / OOP?
Thanks. Mike This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Maellic |
last post by:
Hi,
The company I work for often develops databases for clients. Those
databases always need to do similar tasks. One company might need a
database to do task 1 and task 2, while another company...
|
by: popsovy |
last post by:
Hi,
This is a code reusability question. I want to include a function that sends an email message from my site. I want to include the code for the function only once and then be able to call this...
|
by: mister catering |
last post by:
I have a doubt... why is so dificult to reuse software developed under
the same language (not only c of course) and under the same compiler?.
It seems the language itself is not enough to build a...
|
by: Jerry Mcnealy |
last post by:
There is an interesting article on java.net about SOA reusability,
Shrinking the Lag between Business and IT:
http://today.java.net/pub/a/today/2007/07/24/soa-reusability-shrinking-lag-time.html...
|
by: Max2006 |
last post by:
Hi,
Is there any way to break a web application into separated web projects, so
we can re-use pages\?
I am trying to put aspx pages and/or ascx pages in separated web projects,
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
| |