TextWriter Question

  • Thread starter Thread starter Wayne Wengert
  • Start date Start date
W

Wayne Wengert

I am trying to run a sample from the on-line help and I am getting the error
below on this line of code

Dim writer As TextWriter = New StreamWriter(filename)

The error is:

Type 'TextWriter' is not defined.

I've imported
Imports System.Xml.Serialization

Imports System.IO.TextWriter

Imports System.IO.StreamWriter

But is is still an undefined type? What namespace is that in? The Help
points to the ones I've already included?
 
Wayne said:
I am trying to run a sample from the on-line help and I am getting the error
below on this line of code

Dim writer As TextWriter = New StreamWriter(filename)

The error is:

Type 'TextWriter' is not defined.

I've imported
Imports System.Xml.Serialization

Imports System.IO.TextWriter

Imports System.IO.StreamWriter

But is is still an undefined type? What namespace is that in? The Help
points to the ones I've already included?
try this:
Imports System.IO
 
* "Wayne Wengert said:
I am trying to run a sample from the on-line help and I am getting the error
below on this line of code

Dim writer As TextWriter = New StreamWriter(filename)

The error is:

Type 'TextWriter' is not defined.

I've imported
Imports System.Xml.Serialization

Imports System.IO.TextWriter

Importing the class itself doesn't make much sense here. Instead,
import the namespace that contains the class, in this case that's
'System.IO'. Be sure, you understand the difference between namespace
and class. Namespaces are similar to directories in a file system,
classes, structures etc. are like the files in the file system that are
structured by directories.
 
He said:
Namespaces are similar to directories in a file system,

I say:

Or you could call them a bucket... LOL That description has stuck in my mind
since i watched VBTV

--
HTH,
-- Tom Spink, Über Geek

Woe be the day VBC.EXE says, "OrElse what?"

Please respond to the newsgroup,
so all can benefit
 
Back
Top