*函數名稱:memoprn
*功能說明:打印數據庫的備注字段
*用法說明:memoprn(,,)
* memofld:備注字段名稱 col:打印起始列 width:打印行寬
*調用實例:use dbfname
* =memoprg(fieldname,1,40)
* return
*---------------------------------------------------------
function memoprn
parameters memofld,col,width
private check,memofld,col,width
*-- 儲存原來的 memowidth, printer 的狀態
cur_width = set("memowidth" )
cur_print = iif(set("printer")="on",.t.,.f.)
newwidth = min(_rmargin- _lmargin ,width)
set memowidth to newwidth
define box from col-1 to (col+newwidth+1 ) height memlines((memofld))+2
do while !printstatus()
wait " 打印機不是連機狀態,請檢查并按任一鍵繼續或按esc 鍵退出" ;
window nowait
if lastkey()=27
set memowidth to cur_width && 恢復設置
if cur_print
set printer off
endif
return
endif
enddo
set printer on
store .t. to box
*-- 打印 define box 設定的邊框, 系統內存變量 box 需設為.t.
?? (memofld) at col
store .f. to box
*-- @col,1 say (memofld)
set memowidth to cur_width
if cur_print
set printer off
endif
return