J
jesseyzy
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure Tform1.PrintFile(AFileToPrint: string);
var
Port, FileToPrint: TextFile;
ALine: string;
begin
AssignFile(FileToPrint, AFileToPrint);
Reset(FileToprint);//在这个提示i/o 出错!!!
AssignFile(Port, 'LPT1');
Rewrite(Port);
while not Eof(FileToPrint)do
begin
Readln(FileToPrint, ALine);
Writeln(Port, ALine);
end;
CloseFile(Port);
CloseFile(FileToPrint);
end;
//**************************
下面是调用程序
procedure TForm1.Button1Click(Sender: TObject);
var
outfile,:string;
begin
OutFile:=ExtractFilePath(Application.ExeName )+'output.txt';
PrintFile(Outfile);
end;
请教高手了
var
Port, FileToPrint: TextFile;
ALine: string;
begin
AssignFile(FileToPrint, AFileToPrint);
Reset(FileToprint);//在这个提示i/o 出错!!!
AssignFile(Port, 'LPT1');
Rewrite(Port);
while not Eof(FileToPrint)do
begin
Readln(FileToPrint, ALine);
Writeln(Port, ALine);
end;
CloseFile(Port);
CloseFile(FileToPrint);
end;
//**************************
下面是调用程序
procedure TForm1.Button1Click(Sender: TObject);
var
outfile,:string;
begin
OutFile:=ExtractFilePath(Application.ExeName )+'output.txt';
PrintFile(Outfile);
end;
请教高手了