Where To Store Common Code

W

Wayne Wengert

In VB6 I used to put Public variables, functions and Subs in a BAS Module.
What is the best way to handle this in .NET? From what I see in some books
it looks like I should use a Class Library but two books referred to a
"Module" - I have no idea where that option is?
 
C

Chris Devol

Wayne Wengert said:
In VB6 I used to put Public variables, functions and Subs in a BAS Module.
What is the best way to handle this in .NET? From what I see in some books
it looks like I should use a Class Library but two books referred to a
"Module" - I have no idea where that option is?

A module can store any kind of code. I create a module called "defines"
saved in "defines.vb" to store my global variables. etc., for a project.

Module Defines

...........variable declarations etc......

End Module
 
S

Soni

If u're coding using C# .. then u cannot add the Module file directly
using visual studio 2002. I'm not too sure about 2003. But if u're
coding in VB.NET then u can add a module file under add items ... So
if its C# create a .cs file.. define it like told by Wayne .. and then
add it from "add exisitng items"
That is also good ..
But pls correct me if i'm wrong ..
if u're using C#.. u could store static variables in a class right ..?
I'm not sure if both works out to be the same ..... anyone with more
inputs on that ..?
 

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