关于打印机

txfa 2003-06-12 05:14:28
请教:
如何在vfp中控制打印机的以下功能
1.换行,换多行
2.退行,退多行
3.换页
...全文
122 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
fj_jiangqi 2003-06-18
  • 打赏
  • 举报
回复
用票据打印机就不用退行了,那种打印退行只能人工操作,估计是没有办法了。
txfa 2003-06-18
  • 打赏
  • 举报
回复
非常回答在家这样的热情!!!!!!!!!!!
问题是这样的:我在打印单据时想要单据打完之后出去一点也就是多换几行,
以方便切纸但打第二张时又能自动退行省去手工操作的麻烦?
可否用程序控制此部分, 多谢!!!!!!!!!
magnetmoon 2003-06-14
  • 打赏
  • 举报
回复
可能打印機不能退行。
lz_zxf 2003-06-14
  • 打赏
  • 举报
回复
magnetmoon(天涯明月刀):
1.换行,换多行
@ PROW( ), PCOL( ) + 12 SAY 'Contact person'
@ PROW( ), $+12 SAY 'Contact person'

2.退行,退多行
@ PROW( ), PCOL( ) - 12 SAY 'Contact person'
@ PROW( ), $-12 SAY 'Contact person'
这都是列的移动,不是行的移动
@ PROW( )-2, PCOL( ) SAY 'Contact person'
没用过,有待验证

呵呵,下面给个中文的

向打印机发送换页符。
语法

EJECT

说明
EJECT 命令要求打印机走纸到下一页的顶端。如果系统内存变量 _PADVANCE 设置为 FORMFEED,则 EJECT 命令向打印机发送换页符。如果 _PADVANCE 设置为 LINEFEEDS,则 EJECT 命令将不断发送换行符,直至打印机走纸到下一页的顶端。
EJECT 命令把 PCOL( ) 和 PROW( ) 重置为打印机打印头当前的行、列位置值,但并不影响系统内存变量 _PAGENO 或 _PLINENO 的值。

向打印机发出有条件走纸的指令。
语法

EJECT PAGE

说明
使用 EJECT PAGE 命令可以连续走纸。走纸取决于 _PADVANCE 的值以及 ON PAGE 例程是否有效。
如果 _PADVANCE 设置为 FORMFEED 而 ON PAGE 例程没有运行,则 EJECT PAGE 命令执行下列操作:

? 如果打印机已经联机,则向打印机发送一个换页符。
? 根据系统内存变量 _PLENGTH 和 _PLINENO,向屏幕、某个替补文件或者同时向两者发送换行符。
? _PAGENO 加 1。
? _PLINENO 设置为 0。

如果系统内存变量 _PADVANCE 设置为 LINEFEEDS,而 ON PAGE 例程正在运行,并且 _PLINENO 的值小于 ON PAGE 例程所指定的行数,则 EJECT PAGE 命令将不断向打印机、Visual FoxPro 主窗口或某个替补文件或者以上两者发送换行符,直到打印机走纸到下一页顶端为止。

如果 ON PAGE 例程未执行,或当 _PADVANCE 设置为 LINEFEEDS,并且 _PLINENO 大于 ON PAGE 例程所指定的行号,则 EJECT PAGE 命令执行下列操作:

? 根据系统内存变量 _PLENGTH 和 _PLINENO,向打印机、Visual FoxPro 主窗口或其替补文件或者以上两者发送换行符。
? _PAGENO 加 1。
? _PLINENO 设置为 0。


指定当报表中打印输出到达一定行数,或发出 EJECT PAGE 时,将执行的命令。

语法

ON PAGE
[AT LINE nLineNumber [Command]]

参数
AT LINE nLineNumber [Command]

指定到达预定行数时执行的命令。当 _PLINENO(保存报表中当前行号的系统变量)大于 nLineNumber 指定行号时,执行指定的命令。当发出 EJECT PAGE 命令时也执行 ON PAGE 指定的命令。有关详细内容,请参阅 EJECT PAGE。

说明

ON PAGE 通常使用 DO 来执行一个处理分页、标头和注脚的过程。
不带 AT LINE 子句执行 ON PAGE 命令,将清除 ON PAGE 命令。
kpedu2002 2003-06-13
  • 打赏
  • 举报
回复
chr(10)或CHR(13)是换行
不过如果想控制打印机,则要查看打印机指令才行,以前我曾有一些打印机的参数。但现找不到,您或
用MSDN来查看一下。
lz_zxf 2003-06-13
  • 打赏
  • 举报
回复
我觉得打印机不同,指令可能也不太一样

看看打印机的手册
magnetmoon 2003-06-13
  • 打赏
  • 举报
回复
如何在vfp中控制打印机的以下功能
1.换行,换多行
@ PROW( ), PCOL( ) + 12 SAY 'Contact person'
@ PROW( ), $+12 SAY 'Contact person'

2.退行,退多行
@ PROW( ), PCOL( ) - 12 SAY 'Contact person'
@ PROW( ), $-12 SAY 'Contact person'

3.换页
EJECT PAGE


PROW( ) FunctionSee Also
@ ... SAY | COL( ) | PCOL( ) | ROW( )Returns the current row number of the printer's print head.
PROW( )
Return Values
Numeric
Remarks
If you issue EJECT, Visual FoxPro resets PROW( ) to 0.
PROW( ) is especially useful for relative addressing of printed text.
Example
In the following example, the two commands return the same result. You can use the $ operator in place of PCOL( ). Both $ and PCOL( ) return the current column position of the printer.
@ PROW( ), PCOL( ) + 12 SAY 'Contact person'
@ PROW( ), $+12 SAY 'Contact person'


EJECT PAGE CommandSee Also
EJECT | ON PAGE | SET ALTERNATE | SET DEVICE | SET PRINTER | PCOL( ) | PROW( ) | System Variables Overview
Sends a conditional page advance to the printer.

EJECT PAGE
Remarks
Use EJECT PAGE to advance streaming output. The advance depends on the value of _PADVANCE and if an ON PAGE routine is in effect.

If _PADVANCE is set to FORMFEED and an ON PAGE routine isn't in effect, EJECT PAGE performs the following:

Sends a formfeed to the printer if the printer is online.
Sends linefeeds, as determined by the system memory variables _PLENGTH and _PLINENO, to the screen or to an alternate file or to both.
Increments _PAGENO by 1.
Sets _PLINENO to 0.
If the system memory variable _PADVANCE is set to LINEFEEDS, and if an ON PAGE routine is in effect and _PLINENO is less than the page line number specified in the ON PAGE routine, EJECT PAGE sends to the printer, to the main Visual FoxPro window, or to an alternate file or to both, as many linefeeds as needed to advance to the top of the next page.
If an ON PAGE routine is not in effect, or if _PADVANCE is set to LINEFEEDS and _PLINENO is greater than the page line number specified with ON PAGE, EJECT PAGE does the following:

Sends linefeeds, as determined by the system memory variables _PLENGTH and _PLINENO, to the printer, the main Visual FoxPro window, or to the alternate file or to both.
Increments _PAGENO by 1.
Sets _PLINENO to 0.

ON PAGE CommandSee Also
EJECT PAGE | DO Command | _PLINENO System Variable
Specifies a command that executes when printed output reaches a specified line number in a report or when you issue EJECT PAGE.

ON PAGE [AT LINE nLineNumber [Command]]
Parameters
AT LINE nLineNumber [Command]
Specifies the command to execute at the designated line number. The specified command executes when _PLINENO, the system variable that keeps track of the current line number in a report, becomes greater than the line number specified with nLineNumber. The command specified with ON PAGE also executes when you issue EJECT PAGE. For more information, see EJECT PAGE.
Remarks
ON PAGE typically uses DO to execute a procedure for handling page breaks, headers, and footers.

Executing ON PAGE without the AT LINE clause clears the ON PAGE command.

fj_jiangqi 2003-06-12
  • 打赏
  • 举报
回复
chr(10)是换行
@ row()-1,0 say 退行
chr(12)是换页,可能有错
用专门的打印报表,就没这么多的问题了

2,749

社区成员

发帖
与我相关
我的任务
社区描述
VFP,是Microsoft公司推出的数据库开发软件,用它来开发数据库,既简单又方便。
社区管理员
  • VFP社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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