Program PrintaFile;
Uses DOS;
Begin
SwapVectors;
EXEC('PRINT.EXE','/d:lpt1 qfld.dat');
Writeln(DosError);
SwapVectors;
End.
qfld.dat is a small file in the current directory. When I run the
program, DosError returns 8. I even tried making an .exe file and
running it and it still returned 8 (out of memory). Any ideas?
If you have a better way to print a file, I'll take that too.
Thanks.
--
Rob Kaighn |
rj...@virginia.edu | I once had what it takes,
Civil Engineering | but I'm afraid it's all been taken.
Grad. Student |
>Program PrintaFile;
> Uses DOS;
Try this,
var
OneLine:string;
Printer:text;
Infile:text;
begin
Assign (Infile, 'qfld.dat');
Reset (Infile);
Assign (Printer, LPT1); {assumes you have the printer on LPT1}
Reset (Printer); {LPT1 may need to be in quotes, i am not sure}
repeat
readln (Infile, OneLine);
writeln (Printer, OneLine);
until eof (Infile);
Close (Infile);
Close (printer);
end;
If you have the printer manual look up the control characters. Use
writeln to send them to the printer and set things like unidirectional
printing, continuous feed, colors etc.
I hope this helps.
Syed Reza