Stream Writer not writing full array

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a simple program that collects a string array, and at closing, writes that to a file with the following code
oac_info = CStr(FormatDateTime(Date.Now, DateFormat.LongTime)) + ",
For t = 1 To 20
oac_info = oac_info + CStr(oasis_info(t)) + ",
Nex
oac_info = oac_info + Chr(13
reader.WriteLine(oac_info
reader.WriteLine(oasis_info(210) + Chr(13)
If soc_reason = True Then reader.WriteLine("START OF CARE V1.4CF"
If fol_reason = True Then reader.WriteLine("FOLLOW UP V1.4CF"
If dis_reason = True Then reader.WriteLine("DISCHARGE V1.4CF"
TextBox1.Text = oac_inf
TextBox1.Visible = Tru
reader.WriteLine(Chr(13)

The problem is that the line
reader.WriteLine(oasis_info(210) + Chr(13)
does not write the full variable of oass_info(210

is there a limit to streamreader.writelin

thank
M
 
Hi,

The code fragment is a bit lacking in details, but the oasis_info array
probably contains objects of some type. If these objects aren't Strings,
you might want to override the toString method.

Also, try doing a Flush() on the stream before closing.


Regards,

Elisa
 
Sorry about the vague.

The oac_info that is being written is a string continaing points from a signature. It writes the data fine, but does not wirte it fully. When debugging, I can call the oac_info string and see the full string

thank
mik
 
Hi Mike,

Try calling Flush() and Close() on the stream, e.g. inside the Finally
bit of a Try-Catch-Finally section.


Regards,

Elisa
 
Back
Top