关于打印的一些问题!多谢关注!

caodayong 2002-05-28 07:14:14
我写了一小段代码,进行打印!但打印驱动装不上,提示SPOOL32程序出错!
打印处的代码如下
var
Line,i: Integer;
PrintText: TextFile;
begin

//进行打印
if PrintDialog1.Execute then
begin
AssignPrn(PrintText); {assigns PrintText to the printer}
Rewrite(PrintText); {creates and opens the output file}
Try
Printer.Canvas.Font := Memo1.Font; {assigns Font settings to the canvas}
for Line := 0 to Memo1.Lines.Count - 1 do
Writeln(PrintText, Memo1.Lines[Line]); {writes the contents of the Memo1 to the printer object}
finally
CloseFile(PrintText); {Closes the printer variable}
end;
end; end;
另外:请问:在`delphi`中如何进行实数向整型的转换!我用integer进行强制类型转换没能成功!多谢!
...全文
59 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Afei1 2002-05-28
  • 打赏
  • 举报
回复
同意楼上
netlib 2002-05-28
  • 打赏
  • 举报
回复
按你说的,打印机没有装上,当然不能打印了呀。
建议先安装打印驱动
另:
转换是不行的,实数比整形用的字节数多,你可以用Trunc()取整或Round()四舍五入。

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧