Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB 6
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 16th, 2004, 12:52 AM
Authorized User
Join Date: Aug 2004
Location: , , .
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default Stupid problem


 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

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

Reply With Quote
  #2 (permalink)  
Old December 16th, 2004, 02:39 AM
Authorized User
Join Date: Aug 2004
Location: , , .
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts


  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?

Reply With Quote
  #3 (permalink)  
Old December 16th, 2004, 12:45 PM
Friend of Wrox
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts

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...)
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
really stupid problem with anchor tags thenoseknows ASP.NET 2.0 Basics 3 August 31st, 2006 09:34 AM
Stupid Problem with Example alanmdunsmuir BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 1 May 31st, 2006 08:55 AM
stupid question j_pres44 Beginning PHP 4 December 13th, 2004 05:06 AM
Stupid Problem... on comparing variables! Varg_88 Classic ASP Basics 1 December 11th, 2004 06:00 PM

All times are GMT -4. The time now is 07:10 AM.

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