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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formating Output 1

Status
Not open for further replies.

k4ghg

Technical User
Dec 25, 2001
191
US
I am using VB6, to save date to a file using Print #. I would like to save the data in different formates and need some help. I would like to have a simple three line header with two variables, a tile centered in the middle and than columns of data. I have no problems with the data but and having problems with the header. Is there a way to "Print #" (or some other output function) to file using X,Y locations? At this time I need to solve this problem with code because I cannot add ocx's or other controls.

Example output:
Name: Sam Date:
Salesman: Joe Num:

This is a sales record for Joe:
sales Jan Feb Mar.............................................Total

Thanks Ronnie
 
At the end of the day I imagine you are going to Print the file to a printer or to a screen/ form etc.

In a text file you have no control of x, y positions of your text so when you Print its contents it is best to use a fixed space font (typically Courier new). Given a fixed space font you can then control x position using spaces/ tabs and y position using carriage return/ line feeds.

When you create the file in code you may find the the Space$() and Tab() Statements in vb useful checkout vb help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top