Excellent explanation!
Thank you very much!
Thanks,
Joe Rojas
IT Manager
TNCO, Inc.
781-447-6661 x7506
jrojas@...
________________________________
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Adam Tuliper
Sent: Saturday, March 03, 2007 4:19 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Re:VB.Net - Imports vs References
References: Required before you can use an import - tells the compiler
to
include the specified library in the compile.
Imports: Tells the compiler where to look inside your references
(referenced assemblies) to find "SomeObject" - when you say Imports
Something.Something - these are namespaces - and the imports stmt says
"include this namespace in my search".
For instance, I created my own class called "TextBox", Microsoft has one
of
course. So which one to use when Im writing code?
The compiler will look through your "Imports" to find a TextBox class.
If it
finds multiple, you will get an error. Its quite possible after a while
of
developing you will create a class that has the same name as something
else
in the framework, namespaces will separate your object from the other
developers.
In the case of epicor, to use an object - you need to add your reference
to
Epicor.Mfg.BO.JobPart..etc" and then when you say:
Dim jobAdapt As JobPartAdapter
The compile will look at your "Imports" namespaces and find this object.
If
you have included a reference and don't use "imports" and try to write a
line of code to use it.. it won't be able to find it and you will get an
error. Now, you technically don't need an import. If you want to name
all
your objects with a full name, for ex. You include a reference to some
epicor library containing some class you want to use, you can specify
its
full name:
Dim Dim jobAdapt As Epicor.Mfg.Adapters.JobPartAdapter
In that case you don't need the imports statement because you are
specifying
the full path where that object is found - but its easier to code this
way..
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
Thank you very much!
Thanks,
Joe Rojas
IT Manager
TNCO, Inc.
781-447-6661 x7506
jrojas@...
________________________________
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Adam Tuliper
Sent: Saturday, March 03, 2007 4:19 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Re:VB.Net - Imports vs References
References: Required before you can use an import - tells the compiler
to
include the specified library in the compile.
Imports: Tells the compiler where to look inside your references
(referenced assemblies) to find "SomeObject" - when you say Imports
Something.Something - these are namespaces - and the imports stmt says
"include this namespace in my search".
For instance, I created my own class called "TextBox", Microsoft has one
of
course. So which one to use when Im writing code?
The compiler will look through your "Imports" to find a TextBox class.
If it
finds multiple, you will get an error. Its quite possible after a while
of
developing you will create a class that has the same name as something
else
in the framework, namespaces will separate your object from the other
developers.
In the case of epicor, to use an object - you need to add your reference
to
Epicor.Mfg.BO.JobPart..etc" and then when you say:
Dim jobAdapt As JobPartAdapter
The compile will look at your "Imports" namespaces and find this object.
If
you have included a reference and don't use "imports" and try to write a
line of code to use it.. it won't be able to find it and you will get an
error. Now, you technically don't need an import. If you want to name
all
your objects with a full name, for ex. You include a reference to some
epicor library containing some class you want to use, you can specify
its
full name:
Dim Dim jobAdapt As Epicor.Mfg.Adapters.JobPartAdapter
In that case you don't need the imports statement because you are
specifying
the full path where that object is found - but its easier to code this
way..
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]