chrispybee
Technical User
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%
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%