PB列印斑馬條碼程式

sdvingo發表於2010-11-25
uf_print13( string startcode, string stdtype, long copys ,string direct ) returns string
------------------------------------------------------
long job, i, counter,ll_state
string curr_code, static_part,ls_return
static_part = mid(startcode, 1, 7)
if direct = "N" then
counter = long(mid(startcode, 8, 8))
else
counter = long(mid(startcode, 8, 8)) + copys - 1
end if
job = printopen("barcode 02")
if job= -1 then
messagebox('提示','02分配列印作業失敗!!')
return ''
end if
ls_return=string(job)+':'
for i = 1 to copys
ll_state=printsend(job, "^XA", 10) //開始列印
if i = 1 then ls_return=ls_return+string(ll_state)+'-'
curr_code = static_part + mid(string(100000000+counter), 2, 8)
ll_state=printsend(job, "^BY2,3.0,", 10) //條形碼的寬度
if i = 1 then ls_return=ls_return+string(ll_state)+'-'
ll_state=printsend(job, "^LH30,10", 10) //定義標籤起始位置
if i = 1 then ls_return=ls_return+string(ll_state)+'-'
ll_state=Printsend(job, "^FO20,15^XGXH,1,1^FS",10) // FO20,15表示座標,
if i = 1 then ls_return=ls_return+string(ll_state)+'-'
ll_state=printsend(job, "^FO20,40^BCN,70,N,N,N,N^FD"+curr_code+"^FS",10)//列印條形碼圖形
if i = 1 then ls_return=ls_return+string(ll_state)+'-'
ll_state=printsend(job, "^FO120,120^AD^FDNO:"+curr_code+"^FS",10)//列印條形碼字元
if i = 1 then ls_return=ls_return+string(ll_state)+'-'
ll_state=Printsend(job, "^FO20,165^XGXH,1,1^FS",10)
if i = 1 then ls_return=ls_return+string(ll_state)+'-'
ll_state=printsend(job, "^FO20,190^BCN,70,N,N,N,N^FD"+curr_code+"^FS",10)
if i = 1 then ls_return=ls_return+string(ll_state)+'-'
ll_state=printsend(job, "^FO120,270^AD^FDNO:"+curr_code+"^FS",10)
if i = 1 then ls_return=ls_return+string(ll_state)+'-'
ll_state=Printsend(job, "^FO20,325^XGXH,1,1^FS",10)
if i = 1 then ls_return=ls_return+string(ll_state)+'-'
ll_state=printsend(job, "^FO20,350^BCN,70,N,N,N,N^FD"+curr_code+"^FS",10)
if i = 1 then ls_return=ls_return+string(ll_state)+'-'
ll_state=printsend(job, "^FO120,430^AD^FDNO:"+curr_code+"^FS",10)
if i = 1 then ls_return=ls_return+string(ll_state)+'-'
ll_state=Printsend(job, "^FO20,475^XGXH,1,1^FS",10)
if i = 1 then ls_return=ls_return+string(ll_state)+'-'
ll_state=printsend(job, "^FO20,500^BCN,70,N,N,N,N^FD"+curr_code+"^FS",10)
if i = 1 then ls_return=ls_return+string(ll_state)+'-'
ll_state=printsend(job, "^FO120,580^AD^FDNO:"+curr_code+"^FS",10)
if i = 1 then ls_return=ls_return+string(ll_state)+'-'
/*四聯*///2005-1028 2008-12-06 新格式列印
ll_state=Printsend(job, "^FO20,630^XGXH,1,1^FS",10) //140i3
if i = 1 then ls_return=ls_return+string(ll_state)+'-'
ll_state=printsend(job, "^FO20,655^BCN,70,N,N,N,N^FD"+curr_code+"^FS",10) //列印條形碼圖形
if i = 1 then ls_return=ls_return+string(ll_state)+'-'
ll_state=printsend(job, "^FO120,735^AD^FDNO:"+curr_code+"^FS",10) //列印條形碼字元
if i = 1 then ls_return=ls_return+string(ll_state)+'-'
ll_state=Printsend(job, "^FO18,740^XGhx,1,1^FS",10) //140i3
if i = 1 then ls_return=ls_return+string(ll_state)+'-'
ll_state=Printsend(job, "^FO20,765^XGrq,1,1^FS",10) //140i3
if i = 1 then ls_return=ls_return+string(ll_state)+'-'
/*四聯*///2005-1028
/*
ll_state=Printsend(job, "^FO20,475^XGXH,1,1^FS",10)
if i = 1 then ls_return=ls_return+string(ll_state)+'-'
ll_state=printsend(job, "^FO20,500^BCN,70,N,N,N,N^FD"+curr_code+"^FS",10)
if i = 1 then ls_return=ls_return+string(ll_state)+'-'
ll_state=printsend(job, "^FO120,580^AD^FDNO:"+curr_code+"^FS",10)
if i = 1 then ls_return=ls_return+string(ll_state)+'-'
*/
ll_state=printsend(job, "^XZ", 10)
if i = 1 then ls_return=ls_return+string(ll_state)+'-'
if direct = "N" then
counter = counter + 1
else
counter = counter - 1
end if
next
printclose(job)
return ls_return
[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/443058/viewspace-1042078/,如需轉載,請註明出處,否則將追究法律責任。

相關文章