-
April 25th, 2006, 06:52 AM
#1
TextStream.WriteLine - NewLine problem
Hallo
I'm using VB scripting object to output some text to a file, something like this.
Code:
Dim fp as TextStream
...
fp.WriteLine( "some text" )
fp.WriteLine( "more text" )
The problem appears on a different PC where my programm is installed. Generated text is written as one line in Notepad, with box-character instead of a NewLine.
I have checked in HEX editor, and there is a difference in NewLine character that VB has added on the end of a WriteLine().
On my PC, "some text" is followed with hex 0D 0A
On another PC, "some text" is followed only with hex 0A.
Any idea what's going on here?
-
April 26th, 2006, 04:20 AM
#2
Re: TextStream.WriteLine - NewLine problem
have you tried something like this..?
fp.Write "some text" & vbNewLine
fp.Write "more text" & vbNewLine
Busy
-
April 26th, 2006, 04:24 AM
#3
Re: TextStream.WriteLine - NewLine problem
or might as well you may use the native vb file commands..
Code:
Dim nFile%
nFile = FreeFile()
Open "<filename>" For Output As #nFile
Print #nFile, "some text"
Print #nFile, "more text"
Close #nFile
Busy
-
April 26th, 2006, 08:46 AM
#4
Re: TextStream.WriteLine - NewLine problem
I prefer using Scripting object for writing, and I also had an idea to write an explicit NewLine to my string, but in mean time problem was solved and it was not software-related,
Problem I was trying to solve were missing data during label printing. Since I have found a difference in text-output on my and another PC, I supposed that that caused the problem.
But the solution was trivial: printer ribbon was partially not in place.
Thanks for your answer anyway.
regards
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|