"kimiraikkonen" <ki*************@gmail.comwrote in message
news:11**********************@i38g2000prf.googlegr oups.com...
Hello,
I want to ask about "imports" statement. Some projects must be
inserted with "imports xxxx" statements before beginning coding. But
how do i know when to use or do i have to use "imports" statement?
How will i know which "imports" will my project need? From books or
how can i guess?
Thanks...
You use imports to bring in definitions. For example lets say you want to
use the methods provided within the System.IO namespace (for example
GetTempFileName).
Now without imports you could use the following:
Dim str as String = System.IO.Path.GetTempFileName()
With the imports
Imports System.IO
your code would be:
Dim str as String = Path.GetTempFileName()
Now there are lots of namespaces that hold identical interfaces.
There are both:
Microsoft.VisualBasic.MyServices.FileSystemProxy.G etTempFileName() As String
and
System.IO.Path.GetTempFileName() As String
to use the statement
Dim str as String = GetTempFileName()
you would add the correct imports statement and then you would have good
code.
This is a big subject but I hope what I have written helps.
Lloyd Sheen