Re: StreamWriter.Write and WriteLine?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Chris, Master of All Things Insignificant (chris_at_No_Spam_Please.com)
Date: 01/10/05


Date: Mon, 10 Jan 2005 11:41:42 -0600

I may be misunderstanding your question, so ignore me if I am. You are
asking what WriteLine will do if the file can't handle the length of the
line to be written. I don't think this can happen. A line in a textfile is
just the first instance of CRLF. If there is not a CRLF then the line never
ends as far as the StreamReader is concerned. Can you explain an instance
that the string is too long for line to hold?

Chris

"Nina" <Nina@discussions.microsoft.com> wrote in message
news:11A08F7D-C27C-454C-8909-7D99C94E502B@microsoft.com...
> Hi there,
>
> What is the maximum length that one line can hold in a text file using
> StreamWriter's Write or WriteLine method? If the string is too long for
> one
> line to hold, what will Write or WriteLine do? In order me to retrieve
> data
> correctly from the text file later, I have to know the right index. For
> the
> following code,if str1's length exceeds one line in text file, how can I
> get
> str2's index when reading the text file? Is there any way to handle this
> kind of situation?
>
> ///
> dim sw as streamwriter
> dim str1, str2 as string
> sw.WriteLine(str1)
> sw.WriteLine(str2)
> \\\
>
> I appreciate your help.
>
> Nina



Relevant Pages

  • Re: help please! when a string contains variable references
    ... Maybe I'm just not smart enough to distill the actual problem from your ... elaborate: post some code and the error you are getting. ... evaluated into one string before it's passed on writeline? ... I want to use this variable as the argument for writeline like so: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: StreamWriter ?
    ... Write just writes, WriteLine() adds a \r\n, as Jerry mentioned. ... so you can iterate through the file like so. ... Microsoft Expression Web Bible (upcoming) ... Dim oldLinesas String = File.ReadAllLines ...
    (microsoft.public.dotnet.framework)
  • Re: how to write text in vhdl
    ... function that converts a std_logic_vector into a string. ... a limitation on 'report' you'd have the same issue with the writeline ... The nice thing about Ben's package is that you can just say ...
    (comp.lang.vhdl)
  • help please! when a string contains variable references
    ... I have a variable string, called formatstring The general format of the ... I want to use this variable as the argument for writeline like so: ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: StreamReader - ReadLine
    ... Are you saying it doesn't end in a CrLF or it doesn't end in a Cr or Lf? ... loading it all into a string is probably a bad ... >there is a strange character that looks like a square and I cannot even ... >Dim fsr As StreamReader = File.OpenText ...
    (microsoft.public.dotnet.languages.vb)