Prev: ((System.IO.Stream)(s)).ReadTimeout. What might be wrong?
Next: Some more about regular expression
From: shapper on 20 May 2010 12:10 Hello, I need to us a TextWriter as an argument of a method: System.IO.TextWriter t; _parser.Go(t); However I get, on the second line, the error: Use of unassigned local variable 't' But I am not able to do the following: System.IO.TextWriter t = new TextWriter(); How can I solve this? Thanks, Miguel
From: Family Tree Mike on 20 May 2010 12:24 On 5/20/2010 12:10 PM, shapper wrote: > Hello, > > I need to us a TextWriter as an argument of a method: > > System.IO.TextWriter t; > _parser.Go(t); > > However I get, on the second line, the error: > Use of unassigned local variable 't' > > But I am not able to do the following: > System.IO.TextWriter t = new TextWriter(); > > How can I solve this? > > Thanks, > Miguel > > TextWriter is abstract. You can use StreamWriter, or some other class that extends TextWriter. -- Mike
From: Jackie on 20 May 2010 12:21 On 5/20/2010 18:10, shapper wrote: > Hello, > > I need to us a TextWriter as an argument of a method: > > System.IO.TextWriter t; > _parser.Go(t); > > However I get, on the second line, the error: > Use of unassigned local variable 't' > > But I am not able to do the following: > System.IO.TextWriter t = new TextWriter(); > > How can I solve this? > > Thanks, > Miguel > > TextWriter is an abstract class so you can't instantiate it. You must use one of the derived classes such as StreamWriter and StringWriter. http://msdn.microsoft.com/en-us/library/system.io.textwriter.aspx
From: Jeff Johnson on 20 May 2010 12:26 "shapper" <mdmoura(a)gmail.com> wrote in message news:73d679e2-a3bf-47c3-a39f-7ac550d4f7f2(a)o1g2000vbe.googlegroups.com... > I need to us a TextWriter as an argument of a method: > > System.IO.TextWriter t; > _parser.Go(t); > > However I get, on the second line, the error: > Use of unassigned local variable 't' > > But I am not able to do the following: > System.IO.TextWriter t = new TextWriter(); RTFM. TextWriter is abstract; you can't create instances of it. Create a StreamWriter.
From: Jackie on 20 May 2010 12:36 On 5/20/2010 18:26, Jeff Johnson wrote: > RTFM. TextWriter is abstract; you can't create instances of it. Create a > StreamWriter. > Reading The Fantastic Manual may be a good idea, indeed. :)
|
Next
|
Last
Pages: 1 2 Prev: ((System.IO.Stream)(s)).ReadTimeout. What might be wrong? Next: Some more about regular expression |