A module is merely a class so ultimately there's no difference between a
module and a class -- however modules have all of their properties/methods
that are shared. If you create a sealed class, and make all of the
methods/properties shared, you'll be in the same boat. Many things lend
themselves to static methods (File.Exists) others to instances Dim fi as
new FileInfo
It really depends on the ultimate usage. Modules are convenient in that you
don't have to prefix them, but that can also cause some trouble in some
instances b/c a name in your class shares a name w/ the module. You can
kill the variable you have locally or change its name and you won't see any
immediate errors if they were both of the same type (and if you have option
strict off [which should be outlawed], it's possible even then. C# also
doesn't support modules so using the class driven approach may be more
comfortable programming in both environments.
HTH,
Bill
--
W.G. Ryan MVP Windows - Embedded
http://forums.devbuzz.com http://www.knowdotnet.com/dataaccess.html http://www.msmvps.com/williamryan/
"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I want to write a program with many sub-method.
for example,
1)method :company_search(code) which return name,addresss...etc
2)method:currency(code) which return the current exchange rate....etc
.... manys
Should I write it use module ??? or in code file ??
What is the difference about it ?
Thanks
From Agnes