Where To Store Common Code

  • Thread starter Thread starter Wayne Wengert
  • Start date Start date
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?
 
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
 
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 ..?
 
Back
Top