這里只寫了列印8樣物品的例子,如果更多可增加:
*列印出小票
SET DEVICE TO print &&設定從列印機輸出
*小票格式
@1,1 say "謝謝光臨!" font '微軟雅黑',9 color RGB(0,0,0)
@3,3 say "浪漫一身服裝店" font '微軟雅黑',15 color RGB(0,0,0)
@7,1 say "日期:"font '微軟雅黑',9 color RGB(0,0,0)
@7,7 say DATETIME() font '微軟雅黑',9 color RGB(0,0,0)
@8,1 say "- - - - - - - - - - - - - - - - "
@9,1 say "序號 貨 號 數量 單價" font '微軟雅黑',9 color RGB(0,0,0)
xdy=12
xhj=1
*列印第一件
@10,1 say "1 " font '微軟雅黑',9 color RGB(0,0,0)
@10,5 say thisform.text10.Value font '微軟雅黑',9 color RGB(0,0,0)
@10,18 say "1" font '微軟雅黑',9 color RGB(0,0,0)
@10,20 say thisform.text18.Value font "微軟雅黑",9 color RGB(0,0,0)
*列印第二件
IF NOT EMPTY(thisform.text11.Value ) then
@11,1 say "2 " font '微軟雅黑',9 color RGB(0,0,0)
@11,5 say thisform.text11.Value font '微軟雅黑',9 color RGB(0,0,0)
@11,18 say "1" font '微軟雅黑',9 color RGB(0,0,0)
@11,20 say thisform.text19.Value font "微軟雅黑",9 color RGB(0,0,0)
xdy=xdy+1
xhj=xhj+1
ENDIF
*列印第三件
IF NOT EMPTY(thisform.text12.Value ) then
@12,1 say "3 " font '微軟雅黑',9 color RGB(0,0,0)
@12,5 say thisform.text12.Value font '微軟雅黑',9 color RGB(0,0,0)
@12,18 say "1" font '微軟雅黑',9 color RGB(0,0,0)
@12,20 say thisform.text20.Value font "微軟雅黑",9 color RGB(0,0,0)
xdy=xdy+1
xhj=xhj+1
ENDIF
*列印第四件
IF NOT EMPTY(thisform.text13.Value ) then
@13,1 say "4 " font '微軟雅黑',9 color RGB(0,0,0)
@13,5 say thisform.text13.Value font '微軟雅黑',9 color RGB(0,0,0)
@13,18 say "1" font '微軟雅黑',9 color RGB(0,0,0)
@13,20 say thisform.text21.Value font "微軟雅黑",9 color RGB(0,0,0)
xdy=xdy+1
xhj=xhj+1
ENDIF
*列印第五件
IF NOT EMPTY(thisform.text14.Value ) then
@14,1 say "5 " font '微軟雅黑',9 color RGB(0,0,0)
@14,5 say thisform.text14.Value font '微軟雅黑',9 color RGB(0,0,0)
@14,18 say "1" font '微軟雅黑',9 color RGB(0,0,0)
@14,20 say thisform.text22.Value font "微軟雅黑",9 color RGB(0,0,0)
xdy=xdy+1
xhj=xhj+1
ENDIF
*列印第六件
IF NOT EMPTY(thisform.text15.Value ) then
@15,1 say "6 " font '微軟雅黑',9 color RGB(0,0,0)
@15,5 say thisform.text15.Value font '微軟雅黑',9 color RGB(0,0,0)
@15,18 say "1" font '微軟雅黑',9 color RGB(0,0,0)
@15,20 say thisform.text23.Value font "微軟雅黑",9 color RGB(0,0,0)
xdy=xdy+1
xhj=xhj+1
ENDIF
*列印第七件
IF NOT EMPTY(thisform.text16.Value ) then
@16,1 say "7 " font '微軟雅黑',9 color RGB(0,0,0)
@16,5 say thisform.text16.Value font '微軟雅黑',9 color RGB(0,0,0)
@16,18 say "1" font '微軟雅黑',9 color RGB(0,0,0)
@16,20 say thisform.text24.Value font "微軟雅黑",9 color RGB(0,0,0)
xdy=xdy+1
xhj=xhj+1
ENDIF
*列印第八件
IF NOT EMPTY(thisform.text17.Value ) then
@17,1 say "8 " font '微軟雅黑',9 color RGB(0,0,0)
@17,5 say thisform.text17.Value font '微軟雅黑',9 color RGB(0,0,0)
@17,18 say "1" font '微軟雅黑',9 color RGB(0,0,0)
@17,20 say thisform.text25.Value font "微軟雅黑",9 color RGB(0,0,0)
xdy=xdy+1
xhj=xhj+1
ENDIF
@xdy,1 say "- - - - - - - - - - - - - - - - "
@xdy+1,1 say "合 計:" font "微軟雅黑",10 color RGB(0,0,0)
@xdy+1,8 say STR(xhj,1,0) font '微軟雅黑',10 color RGB(0,0,0)
@xdy+1,11 say "件" font "微軟雅黑",10 color RGB(0,0,0)
@xdy+1,15 say "總額:" font "微軟雅黑",10 color RGB(0,0,0)
@xdy+1,21 say thisform.label31.Caption font "微軟雅黑",10 color RGB(0,0,0)
@xdy+1,27 say "元" font "微軟雅黑",10 color RGB(0,0,0)
@xdy+3,1 say "- - - - - - - - - - - - - - - - "
Set printer to
uj5u.com熱心網友回復:
這些語法,好像是FOXBASE+那個年代的!uj5u.com熱心網友回復:
什么好象,本來就是!
uj5u.com熱心網友回復:
貓不看黑白 語法不看年代 好用就行補充一下這個古老的命令,有時也會用到:
@ <行,列> [SAY <運算式>] [PICTURE <格式符>] [COLOR <顏色對>]
功能:在螢屏指定坐標位置上輸出顯示結果。
PICTURE描述碼和意義
A:只允許字母
L:只允許邏輯資料
N:只允許字母和數字
X:允許任意字符
Y:只允許Y、N、y、n,而且y,n分別被轉化為Y,N
9:對字符資料只允許數字,對數值資料只允許數字和正負號
#:允許數字、空格、正負號
!:轉換小寫字母轉化為大寫字符
$:顯示貨幣號
*:顯示在數字值的前面
.:指出小數點的位置
,:放在小數點的左邊,用于數字的分隔
@<行,列> SAY <位圖檔案名> BITMAP <通用型欄位名> [ISOMETRIC | STRETCH] [ SIZE <數值運算式1>,<數值表 達式2>] [NOWAIT]
功能:將位圖檔案或通用欄位顯示在指定行、列的位置
說明:1)[ISOMETRIC]表示縮放圖片,使其比例適應指定區域的大小
2)[STRETCH]表示在水平垂直兩個方向縮放圖片。
3)[SIZE <數值運算式 1>, <數值運算式 2>]用來指定圖片的大小, <數值運算式 1>為高度,<數值運算式2>為寬度
4)[NOWAIT]表示在執行時不等待
uj5u.com熱心網友回復:
foxpro對foxbase下的命令幾乎都兼容的,用純代碼方式是要快些。轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/82822.html
標籤:VFP
上一篇:vfp怎么提取資料?
下一篇:請問如何改變游標移動順序?
