p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Pro VB 6 (http://p2p.wrox.com/forumdisplay.php?f=73)
-   -   Stupid problem (http://p2p.wrox.com/showthread.php?t=22673)

tsimsha December 16th, 2004 12:52 AM

Stupid problem
 
Hi,

 Today, i got stupid problem.
I am generating the text file from VB

while not rs.eof
strOP=strOP & rs(0) & rs(1) &...& vbcrlf & vbcrlf & vbcrlf
rs.movenext
wend

Using filesystemobject, i am creating a text file with the contents strOP.

If i go to DOS prompt and issue this command c:\mydata.txt > prn

There is no equal spacing b/w lines. But yesterday i was printed correct.
I tried with open "lpt1" for output as #1 also. The same problem.

So, i tried a simple text file from DOS prompt (c:\edit test.txt) and added 8 lines with equal line spacing (as i have from VB, the same spacing - 2lines) and print using type test.txt > prn
its printing in exact alignment.
How come it is like this? Both the way i am using DOS. But on contains data from VB and the other is at DOS.


Pls reply me


tsimsha December 16th, 2004 02:39 AM

Hello,

  When i measure the space b/w lines on the printout

1. Text file generated from VB

   Spacing is varying from 14mm to 16 mm. And some lines with 10mm only.

2. Text file created directly at DOS prompt(edit test.txt)

  Spacing is 10mm only.(Here my printed output is correct)

Both the ways, i opened text files in DOS mode and find the lines gap, its 2 lines only. (Coz i inserted vbcrlf & vbcrlf & vbcrlf. First one is for breaking the line)
And in the direct file, i inserted 2 enters.
Both files looks same when u see.
But printing makes difference.
Why? Whats wrong with me?



BrianWren December 16th, 2004 12:45 PM

Do you have the ability to view these files in an environment that tells you the value of each byte in the file?
(MS C++ environment will let you do this. A program that does this is usually called a 'hex editor'.)

I would first of all want to see if there were characters at the beginning or end of the file that might be causing the printer to handle the files differently.
Next, I would want to see if the non-printing characters used to signify the ends of lines are exactly the same.
(You can use VB file handling--open, get(), etc--to read the files into byte arrays and examine them that way, though it's a bit of work to do so...)


All times are GMT -4. The time now is 06:22 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.