Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2008 Guys... I got a problem... trying to output from an RTB to a text file...

$
0
0
I am trying to print all of my data from a RichTextBox to a text file. in my RTB i am showing everything in its proper place..


BCF-2373 FLEXI MULTI U WO 3 C3730 WO
09271 23731 BTS-1045 U WO 1 5
9AT2373A RF/-
12
IDD-4UD TRX-001 U WO 669 0 3079 MBCCH+CBCH P 1
IDD-4UD TRX-003 U WO 625 0 3079 3
IDD-4UD TRX-005 U WO 631 0 3079 5
09271 23732 BTS-1046 U WO 0 5


etc...

but my textfile is not performing my carriage return/line feeds. all i get is the little squares where my CRs are supposed to be. I tried to do a split when printing to the textfile but it didn't seem to work...

here is my code without the split function...

If BCFctrl.sitexport.CheckState = 1 Then
If InStr(CmdTerm.txtLog.Text, "UNKNOWN COMMAND") > 0 Then
txtlogprt = FreeFile()
FileOpen(txtlogprt, "c:\program files\site tools\nsn\capture.dat", OpenMode.Output)
PrintLine(txtlogprt, CmdTerm.txtLog.Text)
FileClose(txtlogprt)
Call STexport.site_int()
BCFctrl.sitexport.CheckState = System.Windows.Forms.CheckState.Unchecked
Exit Sub
End If
End If


with the split...

If BCFctrl.sitexport.CheckState = 1 Then
If InStr(CmdTerm.txtLog.Text, "UNKNOWN COMMAND") > 0 Then
txtlogprt = FreeFile()
FileOpen(txtlogprt, "c:\program files\site tools\nsn\capture.dat", OpenMode.Output)
arr = Split(CmdTerm.txtLog.Text, vbCrLf)
For sl1 = 0 To UBound(arr)
PrintLine(txtlogprt, arr)
Next
FileClose(txtlogprt)
Call STexport.site_int()
BCFctrl.sitexport.CheckState = System.Windows.Forms.CheckState.Unchecked
Exit Sub
End If
End If


If i can fix this on the front end (at the output) it will save me so much pain and suffering... any ideas?

Thanks...

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>