Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing a line ....

Status
Not open for further replies.

Sillygirl

Programmer
May 3, 2002
80
US
I'm trying to print a line using Printer.Print commands.

Here is a sample of my code:

Printer.Print "Vendor "; Trim$(txtVendor.Text)
Printer.Print "Sid # "; Trim$(txtSid.Text)
Printer.Print "Size "; Trim$(txtSize.Text)
Printer.Print "Received "; Date;
Printer.Print "_____________________"
Printer.Print "SERIAL# "; Trim$(txtSerial.Text)
Printer.Print "DATE"
Printer.Print "circle -> 1 2 3 "
Printer.FontSize = "48"
Printer.Print Trim$(txtOptPart.Text)
Printer.Print Trim$(txtPartCode.Text)

It does print a line but it is not under the line before. It is way off in right field. Does anyone know how to fix this? I'm printing to a dot matrix printer.

Thanks.
Silly girl..

[ponytails]
 
Yep, I think I do. At the end of your code try printing a vbcr:
Code:
Printer.Print VbCr
Based on the behavior you describe, you automatically get a line feed but don't get a carriage return.

HTH

Bob
 
Perhaps you need to flush the printer output after printing all text using EndDoc method.

[tt]Printer.EndDoc[/tt]
 
Printer.Print "Received "; Date[red];[/red][/bold]

Remove the highlighted semi-colon (unless I've misunderstood you)
 
I would do strongm's suggestion first. In case you don't know, semicolon means print the next item on the same line. I looked for extras, obviously not as carefully as strongm did, and didn't see that one. If after that you find that each line is one line lower than the last and starts directly below where the last one ended, try my suggestion. In the time of dot matrix printers, it wasn't very well standardized whether the computer or the printer sent the new line and carriage return characters.

Bob
 
If your referring to these two lines

Printer.Print "Received "; Date;
Printer.Print "_____________________"

remove the ; after Date. The ; tells the printer to stay on the dame line.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top