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

Please, can someone help me on this. Print Spooler!

Status
Not open for further replies.

chrispybee

Technical User
Joined
Jun 12, 2003
Messages
45
Location
GB
Hi Everyone, I've written a program that should get each character and output to a printer. I cannot seem to get this to work. I'm sending the data ok, but it looses it's formatting when outputing. As you can see, I've done this 2 ways and both not working fully.
I really need this to work by the end of the week.

What i need to happen is to open the file and output a line at a time, at the end the original file and the output file to be exactly the same (all characters).

Code:

Open FName For Binary As #10 'Open the original .EPS for Reading

Open Port For Output As #11 'Open Port for output

Do
Line Input #10, CTemp
Print #11, CTemp;
Loop Until EOF(10)
Close #11
Close #10

or

Dim FileHandle%, Spooler As String, N As Long, MaxChr As Long, Div As Long, TmpStep As Long, Crop As String, Port As String, CTempLen As Long, CTemp As String
FileHandle% = FreeFile

Port = "LPT2:"
Open Port For Output As #FileHandle% 'Open Port for output
Text3.Text = ""
Text4.Text = ""

CTemp = Text2.Text
CTempLen = Len(CTemp)
MaxChr = FileLen(FName)
Text4.Text = MaxChr

For N = 1 To MaxChr
Crop = InStr(N, CTemp, "")
Spooler = Mid$(CTemp, N, 1)
Text5.Text = N
Text5.Refresh
Print #FileHandle%, Spooler;
Next N

Close #FileHandle%
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top