一、演示图
备注:Code128C 条码支持奇数条码、奇数位值使用CODEA来计算
二、条码规则(不想写、直接丢链接)
ITF25码规则:
http://www.dzbarcode.com/service/ywmzt/5.html
Code39规则:
1、https://blog.csdn.net/feiliangyy/article/details/110959391
2、https://blog.csdn.net/dragon_wangzhen/article/details/20908841
Code128规则:
1、https://blog.csdn.net/walk_ing/article/details/52712641
2、https://www.chenxublog.com/2018/09/22/wechat-alipay-barcode-code128.html
三、代码
1、数据窗口字段可以放在detail、summary、footer等上面多可以、字段位置用于确认条码的X、Y坐标和高度、宽度不受字段影响
2、源码
2.1、使用方法
uo_barcode barcode
barcode= create uo_barcode
//条码内容、数据窗口、字段、颜色、是否生成校验码(code39)
//ITF25
barcode.of_barcode_itf25(sle_barcode.text,dw_1,'a',il_color)
//Code39
barcode.of_barcode39(sle_barcode.text,dw_1,'a',il_color,false)
//Code128A
barcode.of_barcode128(sle_barcode.text,dw_1,'a',il_color,'a')
//Code128B
barcode.of_barcode128(sle_barcode.text,dw_1,'a',il_color,'b')
//Code128C
barcode.of_barcode128(sle_barcode.text,dw_1,'a',il_color,'c')
2.2、创建Custom Class类型对象、命名为 uo_barcode
forward
global type uo_barcode from nonvisualobject
end type
end forward
global type uo_barcode from nonvisualobject
end type
global uo_barcode uo_barcode
type variables
string is_etable39[44,4] //Code39 [44,字符、逻辑型态、编码、值]
string is_etable128[107,6] //Code128 [107,ID、Code128A、Code128B、Code128C、逻辑型态、编码]
int ii_linew = 7 //线条宽度 固定7
string is_arrLine[] //存储线条名称
string is_null[]
string is_codeValue[] //ITF25
end variables
forward prototypes
public subroutine of_initial ()
public subroutine of_barcode39 (string as_str, datawindow adw_dw, string as_column, long al_rgb, boolean ab_checkbit)
public function string of_get_etable39 (string as_str, integer ai_query_index, integer ai_return_index)
public subroutine of_barcode_itf25 (string as_str, datawindow adw_dw, string as_column, long al_rgb)
public subroutine of_reset (datawindow adw_dw)
public subroutine of_initial128_1 ()
public subroutine of_initial128_2 ()
public function string of_get_etable128 (string as_str, integer ai_query_index, integer ai_return_index)
public subroutine of_barcode128 (string as_str, datawindow adw_dw, string as_column, long al_rgb, string as_type)
end prototypes
public subroutine of_initial ();//===ITF25===
is_codeValue[] = {'nnwwn','wnnnw','nwnnw','wwnnn','nnwnw','wnwnn','nwwnn','nnnww','wnnwn','nwnwn'}
//===Code39 对照表===
is_etable39[1,1] = '0'
is_etable39[1,2] = '101001101101'
is_etable39[1,3] = 'nnnwwnwnnn'
is_etable39[1,4] = '0'
is_etable39[2,1] = '1'
is_etable39[2,2] = '110100101011'
is_etable39[2,3] = 'wnnwnnnnwn'
is_etable39[2,4] = '1'
is_etable39[3,1] = '2'
is_etable39[3,2] = '101100101011'
is_etable39[3,3] = 'nnwwnnnnwn'
is_etable39[3,4] = '2'
is_etable39[4,1] = '3'
is_etable39[4,2] = '110110010101'
is_etable39[4,3] = 'wnwwnnnnnn'
is_etable39[4,4] = '3'
is_etable39[5,1] = '4'
is_etable39[5,2] = '101001101011'
is_etable39[5,3] = 'nnnwwnnnwn'
is_etable39[5,4] = '4'
is_etable39[6,1] = '5'
is_etable39[6,2] = '110100110101'
is_etable39[6,3] = 'wnnwwnnnnn'
is_etable39[6,4] = '5'
is_etable39[7,1] = '6'
is_etable39[7,2] = '101100110101'
is_etable39[7,3] = 'nnwwwnnnnn'
is_etable39[7,4] = '6'
is_etable39[8,1] = '7'
is_etable39[8,2] = '101001011011'
is_etable39[8,3] = 'nnnwnnwnwn'
is_etable39[8,4] = '7'
is_etable39[9,1] = '8'
is_etable39[9,2] = '110100101101'
is_etable39[9,3] = 'wnnwnnwnnn'
is_etable39[9,4] = '8'
is_etable39[10,1] = '9'
is_etable39[10,2] = '101100101101'
is_etable39[10,3] = 'nnwwnnwnnn'
is_etable39[10,4] = '9'
is_etable39[11,1] = 'A'
is_etable39[11,2] = '110101001011'
is_etable39[11,3] = 'wnnnnwnnwn'
is_etable39[11,4] = '10'
is_etable39[12,1] = 'B'
is_etable39[12,2] = '101101001011'
is_etable39[12,3] = 'nnwnnwnnwn'
is_etable39[12,4] = '11'
is_etable39[13,1] = 'C'
is_etable39[13,2] = '110110100101'
is_etable39[13,3] = 'wnwnnwnnnn'
is_etable39[13,4] = '12'
is_etable39[14,1] = 'D'
is_etable39[14,2] = '101011001011'
is_etable39[14,3] = 'nnnnwwnnwn'
is_etable39[14,4] = '13'
is_etable39[15,1] = 'E'
is_etable39[15,2] = '110101100101'
is_etable39[15,3] = 'wnnnwwnnnn'
is_etable39[15,4] = '14'
is_etable39[16,1] = 'F'
is_etable39[16,2] = '101101100101'
is_etable39[16,3] = 'nnwnwwnnnn'
is_etable39[16,4] = '15'
is_etable39[17,1] = 'G'
is_etable39[17,2] = '101010011011'
is_etable39[17,3] = 'nnnnnwwnwn'
is_etable39[17,4] = '16'
is_etable39[18,1] = 'H'
is_etable39[18,2] = '110101001101'
is_etable39[18,3] = 'wnnnnwwnnn'
is_etable39[18,4] = '17'
is_etable39[19,1] = 'I'
is_etable39[19,2] = '101101001101'
is_etable39[19,3] = 'nnwnnwwnnn'
is_etable39[19,4] = '18'
is_etable39[20,1] = 'J'
is_etable39[20,2] = '101011001101'
is_etable39[20,3] = 'nnnnwwwnnn'
is_etable39[20,4] = '19'
is_etable39[21,1] = 'K'
is_etable39[21,2] = '110101010011'
is_etable39[21,3] = 'wnnnnnnwwn'
is_etable39[21,4] = '20'
is_etable39[22,1] = 'L'
is_etable39[22,2] = '101101010011'
is_etable39[22,3] = 'nnwnnnnwwn'
is_etable39[22,4] = '21'
is_etable39[23,1] = 'M'
is_etable39[23,2] = '110110101001'
is_etable39[23,3] = 'wnwnnnnwnn'
is_etable39[23,4] = '22'
is_etable39[24,1] = 'N'
is_etable39[24,2] = '101011010011'
is_etable39[24,3] = 'nnnnwnnwwn'
is_etable39[24,4] = '23'
is_etable39[25,1] = 'O'
is_etable39[25,2] = '110101101001'
is_etable39[25,3] = 'wnnnwnnwnn'
is_etable39[25,4] = '24'
is_etable39[26,1] = 'P'
is_etable39[26,2] = '101101101001'
is_etable39[26,3] = 'nnwnwnnwnn'
is_etable39[26,4] = '25'
is_etable39[27,1] = 'Q'
is_etable39[27,2] = '101010110011'
is_etable39[27,3] = 'nnnnnnwwwn'
is_etable39[27,4] = '26'
is_etable39[28,1] = 'R'
is_etable39[28,2] = '110101011001'
is_etable39[28,3] = 'wnnnnnwwnn'
is_etable39[28,4] = '27'
is_etable39[29,1] = 'S'
is_etable39[29,2] = '101101011001'
is_etable39[29,3] = 'nnwnnnwwnn'
is_etable39[29,4] = '28'
is_etable39[30,1] = 'T'
is_etable39[30,2] = '101011011001'
is_etable39[30,3] = 'nnnnwnwwnn'
is_etable39[30,4] = '29'
is_etable39[31,1] = 'U'
is_etable39[31,2] = '110010101011'
is_etable39[31,3] = 'wwnnnnnnwn'
is_etable39[31,4] = '30'
is_etable39[32,1] = 'V'
is_etable39[32,2] = '100110101011'
is_etable39[32,3] = 'nwwnnnnnwn'
is_etable39[32,4] = '31'
is_etable39[33,1] = 'W'
is_etable39[33,2] = '110011010101'
is_etable39[33,3] = 'wwwnnnnnnn'
is_etable39[33,4] = '32'
is_etable39[34,1] = 'X'
is_etable39[34,2] = '100101101011'
is_etable39[34,3] = 'nwnnwnnnwn'
is_etable39[34,4] = '33'
is_etable39[35,1] = 'Y'
is_etable39[35,2] = '110010110101'
is_etable39[35,3] = 'wwnnwnnnnn'
is_etable39[35,4] = '34'
is_etable39[36,1] = 'Z'
is_etable39[36,2] = '100110110101'
is_etable39[36,3] = 'nwwnwnnnnn'
is_etable39[36,4] = '35'
is_etable39[37,1] = '-'
is_etable39[37,2] = '100101011011'
is_etable39[37,3] = 'nwnnnnwnwn'
is_etable39[37,4] = '36'
is_etable39[38,1] = ' '
is_etable39[38,2] = '100110101101'
is_etable39[38,3] = 'nwwnnnwnnn'
is_etable39[38,4] = '37'
is_etable39[39,1] = '.'
is_etable39[39,2] = '110010101101'
is_etable39[39,3] = 'wwnnnnwnnn'
is_etable39[39,4] = '38'
is_etable39[40,1] = '$'
is_etable39[40,2] = '100100100101'
is_etable39[40,3] = 'nwnwnwnnnn'
is_etable39[40,4] = '39'
is_etable39[41,1] = '/'
is_etable39[41,2] = '100100101001'
is_etable39[41,3] = 'nwnwnnnwnn'
is_etable39[41,4] = '40'
is_etable39[42,1] = '+'
is_etable39[42,2] = '100101001001'
is_etable39[42,3] = 'nwnnnwnwnn'
is_etable39[42,4] = '41'
is_etable39[43,1] = '%'
is_etable39[43,2] = '101001001001'
is_etable39[43,3] = 'nnnwnwnwnn'
is_etable39[43,4] = '42'
is_etable39[44,1] = '*'
is_etable39[44,2] = '100101101101'
is_etable39[44,3] = 'nwnnwnwnnn'
is_etable39[44,4] = ''
end subroutine
public subroutine of_barcode39 (string as_str, datawindow adw_dw, string as_column, long al_rgb, boolean ab_checkbit);//================================
//of_barcode39
//--------------------------------
//ls_str - 条码内容
//adw_dw - 需要绘制条码的数据窗口
//as_column - 绘制条码在 XXX 列上
//al_rgb - 条码颜色
//ab_checkbit - 是否生成检验位
//================================
char ls_charStr[],ls_bit[],ls_char[]
string ls_arr[],ls_valueArr[]
int li_for,li_for2
string ls_str,ls_value
long ll_number = 0,ll_num = 0
ls_str = as_str
if isnull(ls_str) or ls_str = '' then return
ls_charStr = ls_str
adw_dw.setredraw(false)
of_reset(adw_dw) //清除线条
//===================================================
//起始位
ls_valueArr[upperbound(ls_valueArr) + 1] = of_get_etable39('*',1,2)
//数据位、每个字符获取对应编码
for li_for = 1 to upperbound(ls_charStr)
ls_value = of_get_etable39(ls_charStr[li_for],1,2)
ll_num = long(of_get_etable39(ls_charStr[li_for],1,4))
if ls_value = '' or isnull(ls_value) then
messagebox("提示","条码内容错误!!!")
adw_dw.setredraw(true)
return
end if
ll_number = ll_number + ll_num
ls_valueArr[upperbound(ls_valueArr) + 1] = ls_value
next
//检验位
if ab_checkbit then ls_valueArr[upperbound(ls_valueArr) + 1] = of_get_etable39(string(mod(ll_number,43)),4,2)
//停止位
ls_valueArr[upperbound(ls_valueArr) + 1] = of_get_etable39('*',1,2)
//===================================================
//===================================================
//绘制条码 || 字段作用只是确认X、Y坐标和高度、宽度不适用
long ll_width,ll_height
long ll_y,ll_x,ll_x2,ll_y2,ll_color
string ls_name,ls_band
ls_band = adw_dw.describe(as_column + ".band")
ll_x = long(adw_dw.describe(as_column+".x"))
ll_y = long(adw_dw.describe(as_column+".y"))
ll_height = long(adw_dw.describe(as_column+".height"))
ll_x2 = ll_x
ll_y2 = ll_y + ll_height
for li_for = 1 to upperbound(ls_valueArr)
ls_char = ls_valueArr[li_for]
for li_for2 = 1 to upperbound(ls_char)
ls_value = ls_char[li_for2]
if ls_value = '1' then
ll_color = al_rgb
else
ll_color = 16777215 //白色
end if
ls_name = 'l_' + string(li_for) + '_' + string(li_for2)
is_arrLine[upperbound(is_arrLine) + 1] = ls_name
adw_dw.Modify('create line(band='+ ls_band +' x1="'+string(ll_x2)+'" y1="'+string(ll_y)+'" x2="'+string(ll_x2)+'" y2="'+string(ll_y2)+'" name='+ls_name+' visible="1" pen.style="0" pen.width="'+string(ii_linew)+'" pen.color="'+string(ll_color)+'" background.mode="2" background.color="1073741824" )')
ll_x2 = ll_x2 + ii_linew
next
//一组过后需要多增加一个空白窄线条
ls_name = 'll_' + string(li_for)
is_arrLine[upperbound(is_arrLine) + 1] = ls_name
adw_dw.Modify('create line(band='+ ls_band +' x1="'+string(ll_x2)+'" y1="'+string(ll_y)+'" x2="'+string(ll_x2)+'" y2="'+string(ll_y2)+'" name='+ls_name+' visible="1" pen.style="0" pen.width="'+string(ii_linew)+'" pen.color="16777215" background.mode="2" background.color="1073741824" )')
ll_x2 = ll_x2 + ii_linew
next
adw_dw.setredraw(true)
end subroutine
public function string of_get_etable39 (string as_str, integer ai_query_index, integer ai_return_index);int li_for
long ll_number
string ls_return = ''
for li_for = 1 to upperbound(is_etable39)
if is_etable39[li_for,ai_query_index] = as_str then
ls_return = is_etable39[li_for,ai_return_index]
exit
end if
next
return ls_return
end function
public subroutine of_barcode_itf25 (string as_str, datawindow adw_dw, string as_column, long al_rgb);string ls_valueArray[]
char ls_bit[],ls_bit2[],ls_charStr[],ls_null[]
string ls_text,ls_char,ls_str
long ll_oddNumber = 0,ll_evenNumber =0,ll_number
int li_for,li_for2,li_index
ls_str = as_str
if isnull(ls_str) or ls_str = '' then return
if not isnumber(ls_str) then
messagebox("提示","条码内容错误!!!")
return
end if
adw_dw.setredraw(false)
of_reset(adw_dw) //清除线条
//奇数位,左侧补0
if mod(len(ls_str),2) <> 0 then ls_str = '0' + ls_str
//检验位
for li_for = 1 to len(ls_barcode)
ls_char = mid(ls_barcode,li_for,1)
if mod(li_for,2) = 0 then
ll_evenNumber = ll_evenNumber+long(ls_char)
else
ll_oddNumber = ll_oddNumber+long(ls_char)
end if
next
ll_number =(3*ll_oddNumber) + ll_evenNumber
ll_number = 10 -long(right(string(ll_number),1))
if ll_number = 10 then ll_number = 0
ls_barcode = ls_barcode+string(ll_number)
messagebox("",ls_barcode)
ls_charStr = ls_str
//数值转换成对应码值、[nnwwn],[nnwwn],[nnwwn],[nnwwn]
for li_for = 1 to upperbound(ls_charStr)
if not isnumber(ls_charStr[li_for]) then
messagebox("提示","条码内容错误!!!")
adw_dw.setredraw(true)
return
end if
li_index = integer(ls_charStr[li_for]) + 1
ls_valueArray[upperbound(ls_valueArray) + 1] = is_codeValue[li_index]
next
//2组,2组交叉
for li_for2 = 1 to upperbound(ls_valueArray) step 2
ls_bit = ls_valueArray[li_for2]
ls_bit2 = ls_valueArray[li_for2 + 1]
for li_for = 1 to 5
ls_text = ls_text + ls_bit[li_for]+ ls_bit2[li_for]
next
next
//ITF25码开始模式为窄条,窄空,窄条,窄空,非条码字符
//ITF25码结束模式为宽条,窄空,窄条,非条码字符
ls_text = 'nnnn'+ ls_text + 'wnn'
//绘制条码 || 字段作用只是确认X、Y坐标和高度、宽度不适用
long ll_width,ll_height,ll_linew
long ll_y,ll_x,ll_x2,ll_y2,ll_color
string ls_value,ls_name,ls_band
ls_band = adw_dw.describe(as_column + ".band")
ll_x = long(adw_dw.describe(as_column+".x"))
ll_y = long(adw_dw.describe(as_column+".y"))
ll_height = long(adw_dw.describe(as_column+".height"))
ll_x2 = ll_x
ll_y2 = ll_y + ll_height
for li_for = 1 to lenW(ls_text)
ls_char = mid(ls_text,li_for,1)
if mod(li_for,2) <> 0 then
ll_color = al_rgb
else
ll_color = 16777215 //白色
end if
if ls_char = 'w' then //粗线、多画一条
ls_name = 'l_' + string(li_for) + string(li_for)
is_arrLine[upperbound(is_arrLine) + 1] = ls_name
adw_dw.Modify('create line(band='+ ls_band +' x1="'+string(ll_x2)+'" y1="'+string(ll_y)+'" x2="'+string(ll_x2)+'" y2="'+string(ll_y2)+'" name='+ls_name+' visible="1" pen.style="0" pen.width="'+string(ii_linew)+'" pen.color="'+string(ll_color)+'" background.mode="2" background.color="1073741824" )')
ll_x2 = ll_x2 + ii_linew
end if
ls_name = 'l_' + string(li_for)
is_arrLine[upperbound(is_arrLine) + 1] = ls_name
adw_dw.Modify('create line(band='+ ls_band +' x1="'+string(ll_x2)+'" y1="'+string(ll_y)+'" x2="'+string(ll_x2)+'" y2="'+string(ll_y2)+'" name='+ls_name+' visible="1" pen.style="0" pen.width="'+string(ii_linew)+'" pen.color="'+string(ll_color)+'" background.mode="2" background.color="1073741824" )')
ll_x2 = ll_x2 + ii_linew
next
adw_dw.setredraw(true)
end subroutine
public subroutine of_reset (datawindow adw_dw);//清空线条
int li_for
for li_for =1 to upperbound(is_arrLine)
adw_dw.modify("destroy "+is_arrLine[li_for])
next
is_arrLine = is_null
end subroutine
public subroutine of_initial128_1 ();is_etable128[1,1] = '0'
is_etable128[1,2] = 'SP'
is_etable128[1,3] = 'SP'
is_etable128[1,4] = '0'
is_etable128[1,5] = '212222'
is_etable128[1,6] = 'bbsbbssbbss'
is_etable128[2,1] = '1'
is_etable128[2,2] = '!'
is_etable128[2,3] = '!'
is_etable128[2,4] = '1'
is_etable128[2,5] = '222122'
is_etable128[2,6] = 'bbssbbsbbss'
is_etable128[3,1] = '2'
is_etable128[3,2] = '"'
is_etable128[3,3] = '"'
is_etable128[3,4] = '2'
is_etable128[3,5] = '222221'
is_etable128[3,6] = 'bbssbbssbbs'
is_etable128[4,1] = '3'
is_etable128[4,2] = '#'
is_etable128[4,3] = '#'
is_etable128[4,4] = '3'
is_etable128[4,5] = '121223'
is_etable128[4,6] = 'bssbssbbsss'
is_etable128[5,1] = '4'
is_etable128[5,2] = '$'
is_etable128[5,3] = '$'
is_etable128[5,4] = '4'
is_etable128[5,5] = '121322'
is_etable128[5,6] = 'bssbsssbbss'
is_etable128[6,1] = '5'
is_etable128[6,2] = '%'
is_etable128[6,3] = '%'
is_etable128[6,4] = '5'
is_etable128[6,5] = '131222'
is_etable128[6,6] = 'bsssbssbbss'
is_etable128[7,1] = '6'
is_etable128[7,2] = '&'
is_etable128[7,3] = '&'
is_etable128[7,4] = '6'
is_etable128[7,5] = '122213'
is_etable128[7,6] = 'bssbbssbsss'
is_etable128[8,1] = '7'
is_etable128[8,2] = '~''
is_etable128[8,3] = '~''
is_etable128[8,4] = '7'
is_etable128[8,5] = '122312'
is_etable128[8,6] = 'bssbbsssbss'
is_etable128[9,1] = '8'
is_etable128[9,2] = '('
is_etable128[9,3] = '('
is_etable128[9,4] = '8'
is_etable128[9,5] = '132212'
is_etable128[9,6] = 'bsssbbssbss'
is_etable128[10,1] = '9'
is_etable128[10,2] = ')'
is_etable128[10,3] = ')'
is_etable128[10,4] = '9'
is_etable128[10,5] = '221213'
is_etable128[10,6] = 'bbssbssbsss'
is_etable128[11,1] = '10'
is_etable128[11,2] = '*'
is_etable128[11,3] = '*'
is_etable128[11,4] = '10'
is_etable128[11,5] = '221312'
is_etable128[11,6] = 'bbssbsssbss'
is_etable128[12,1] = '11'
is_etable128[12,2] = '+'
is_etable128[12,3] = '+'
is_etable128[12,4] = '11'
is_etable128[12,5] = '231212'
is_etable128[12,6] = 'bbsssbssbss'
is_etable128[13,1] = '12'
is_etable128[13,2] = ','
is_etable128[13,3] = ','
is_etable128[13,4] = '12'
is_etable128[13,5] = '112232'
is_etable128[13,6] = 'bsbbssbbbss'
is_etable128[14,1] = '13'
is_etable128[14,2] = '-'
is_etable128[14,3] = '-'
is_etable128[14,4] = '13'
is_etable128[14,5] = '122132'
is_etable128[14,6] = 'bssbbsbbbss'
is_etable128[15,1] = '14'
is_etable128[15,2] = '.'
is_etable128[15,3] = '.'
is_etable128[15,4] = '14'
is_etable128[15,5] = '122231'
is_etable128[15,6] = 'bssbbssbbbs'
is_etable128[16,1] = '15'
is_etable128[16,2] = '/'
is_etable128[16,3] = '/'
is_etable128[16,4] = '15'
is_etable128[16,5] = '113222'
is_etable128[16,6] = 'bsbbbssbbss'
is_etable128[17,1] = '16'
is_etable128[17,2] = '0'
is_etable128[17,3] = '0'
is_etable128[17,4] = '16'
is_etable128[17,5] = '123122'
is_etable128[17,6] = 'bssbbbsbbss'
is_etable128[18,1] = '17'
is_etable128[18,2] = '1'
is_etable128[18,3] = '1'
is_etable128[18,4] = '17'
is_etable128[18,5] = '123221'
is_etable128[18,6] = 'bssbbbssbbs'
is_etable128[19,1] = '18'
is_etable128[19,2] = '2'
is_etable128[19,3] = '2'
is_etable128[19,4] = '18'
is_etable128[19,5] = '223211'
is_etable128[19,6] = 'bbssbbbssbs'
is_etable128[20,1] = '19'
is_etable128[20,2] = '3'
is_etable128[20,3] = '3'
is_etable128[20,4] = '19'
is_etable128[20,5] = '221132'
is_etable128[20,6] = 'bbssbsbbbss'
is_etable128[21,1] = '20'
is_etable128[21,2] = '4'
is_etable128[21,3] = '4'
is_etable128[21,4] = '20'
is_etable128[21,5] = '221231'
is_etable128[21,6] = 'bbssbssbbbs'
is_etable128[22,1] = '21'
is_etable128[22,2] = '5'
is_etable128[22,3] = '5'
is_etable128[22,4] = '21'
is_etable128[22,5] = '213212'
is_etable128[22,6] = 'bbsbbbssbss'
is_etable128[23,1] = '22'
is_etable128[23,2] = '6'
is_etable128[23,3] = '6'
is_etable128[23,4] = '22'
is_etable128[23,5] = '223112'
is_etable128[23,6] = 'bbssbbbsbss'
is_etable128[24,1] = '23'
is_etable128[24,2] = '7'
is_etable128[24,3] = '7'
is_etable128[24,4] = '23'
is_etable128[24,5] = '312131'
is_etable128[24,6] = 'bbbsbbsbbbs'
is_etable128[25,1] = '24'
is_etable128[25,2] = '8'
is_etable128[25,3] = '8'
is_etable128[25,4] = '24'
is_etable128[25,5] = '311222'
is_etable128[25,6] = 'bbbsbssbbss'
is_etable128[26,1] = '25'
is_etable128[26,2] = '9'
is_etable128[26,3] = '9'
is_etable128[26,4] = '25'
is_etable128[26,5] = '321122'
is_etable128[26,6] = 'bbbssbsbbss'
is_etable128[27,1] = '26'
is_etable128[27,2] = ':'
is_etable128[27,3] = ':'
is_etable128[27,4] = '26'
is_etable128[27,5] = '321221'
is_etable128[27,6] = 'bbbssbssbbs'
is_etable128[28,1] = '27'
is_etable128[28,2] = ';'
is_etable128[28,3] = ';'
is_etable128[28,4] = '27'
is_etable128[28,5] = '312212'
is_etable128[28,6] = 'bbbsbbssbss'
is_etable128[29,1] = '28'
is_etable128[29,2] = '<'
is_etable128[29,3] = '<'
is_etable128[29,4] = '28'
is_etable128[29,5] = '322112'
is_etable128[29,6] = 'bbbssbbsbss'
is_etable128[30,1] = '29'
is_etable128[30,2] = '='
is_etable128[30,3] = '='
is_etable128[30,4] = '29'
is_etable128[30,5] = '322211'
is_etable128[30,6] = 'bbbssbbssbs'
is_etable128[31,1] = '30'
is_etable128[31,2] = '>'
is_etable128[31,3] = '>'
is_etable128[31,4] = '30'
is_etable128[31,5] = '212123'
is_etable128[31,6] = 'bbsbbsbbsss'
is_etable128[32,1] = '31'
is_etable128[32,2] = '?'
is_etable128[32,3] = '?'
is_etable128[32,4] = '31'
is_etable128[32,5] = '212321'
is_etable128[32,6] = 'bbsbbsssbbs'
is_etable128[33,1] = '32'
is_etable128[33,2] = '@'
is_etable128[33,3] = '@'
is_etable128[33,4] = '32'
is_etable128[33,5] = '232121'
is_etable128[33,6] = 'bbsssbbsbbs'
is_etable128[34,1] = '33'
is_etable128[34,2] = 'A'
is_etable128[34,3] = 'A'
is_etable128[34,4] = '33'
is_etable128[34,5] = '111323'
is_etable128[34,6] = 'bsbsssbbsss'
is_etable128[35,1] = '34'
is_etable128[35,2] = 'B'
is_etable128[35,3] = 'B'
is_etable128[35,4] = '34'
is_etable128[35,5] = '131123'
is_etable128[35,6] = 'bsssbsbbsss'
is_etable128[36,1] = '35'
is_etable128[36,2] = 'C'
is_etable128[36,3] = 'C'
is_etable128[36,4] = '35'
is_etable128[36,5] = '131321'
is_etable128[36,6] = 'bsssbsssbbs'
is_etable128[37,1] = '36'
is_etable128[37,2] = 'D'
is_etable128[37,3] = 'D'
is_etable128[37,4] = '36'
is_etable128[37,5] = '112313'
is_etable128[37,6] = 'bsbbsssbsss'
is_etable128[38,1] = '37'
is_etable128[38,2] = 'E'
is_etable128[38,3] = 'E'
is_etable128[38,4] = '37'
is_etable128[38,5] = '132113'
is_etable128[38,6] = 'bsssbbsbsss'
is_etable128[39,1] = '38'
is_etable128[39,2] = 'F'
is_etable128[39,3] = 'F'
is_etable128[39,4] = '38'
is_etable128[39,5] = '132311'
is_etable128[39,6] = 'bsssbbsssbs'
is_etable128[40,1] = '39'
is_etable128[40,2] = 'G'
is_etable128[40,3] = 'G'
is_etable128[40,4] = '39'
is_etable128[40,5] = '211313'
is_etable128[40,6] = 'bbsbsssbsss'
is_etable128[41,1] = '40'
is_etable128[41,2] = 'H'
is_etable128[41,3] = 'H'
is_etable128[41,4] = '40'
is_etable128[41,5] = '231113'
is_etable128[41,6] = 'bbsssbsbsss'
is_etable128[42,1] = '41'
is_etable128[42,2] = 'I'
is_etable128[42,3] = 'I'
is_etable128[42,4] = '41'
is_etable128[42,5] = '231311'
is_etable128[42,6] = 'bbsssbsssbs'
is_etable128[43,1] = '42'
is_etable128[43,2] = 'J'
is_etable128[43,3] = 'J'
is_etable128[43,4] = '42'
is_etable128[43,5] = '112133'
is_etable128[43,6] = 'bsbbsbbbsss'
is_etable128[44,1] = '43'
is_etable128[44,2] = 'K'
is_etable128[44,3] = 'K'
is_etable128[44,4] = '43'
is_etable128[44,5] = '112331'
is_etable128[44,6] = 'bsbbsssbbbs'
is_etable128[45,1] = '44'
is_etable128[45,2] = 'L'
is_etable128[45,3] = 'L'
is_etable128[45,4] = '44'
is_etable128[45,5] = '132131'
is_etable128[45,6] = 'bsssbbsbbbs'
is_etable128[46,1] = '45'
is_etable128[46,2] = 'M'
is_etable128[46,3] = 'M'
is_etable128[46,4] = '45'
is_etable128[46,5] = '113123'
is_etable128[46,6] = 'bsbbbsbbsss'
is_etable128[47,1] = '46'
is_etable128[47,2] = 'N'
is_etable128[47,3] = 'N'
is_etable128[47,4] = '46'
is_etable128[47,5] = '113321'
is_etable128[47,6] = 'bsbbbsssbbs'
is_etable128[48,1] = '47'
is_etable128[48,2] = 'O'
is_etable128[48,3] = 'O'
is_etable128[48,4] = '47'
is_etable128[48,5] = '133121'
is_etable128[48,6] = 'bsssbbbsbbs'
is_etable128[49,1] = '48'
is_etable128[49,2] = 'P'
is_etable128[49,3] = 'P'
is_etable128[49,4] = '48'
is_etable128[49,5] = '313121'
is_etable128[49,6] = 'bbbsbbbsbbs'
is_etable128[50,1] = '49'
is_etable128[50,2] = 'Q'
is_etable128[50,3] = 'Q'
is_etable128[50,4] = '49'
is_etable128[50,5] = '211331'
is_etable128[50,6] = 'bbsbsssbbbs'
is_etable128[51,1] = '50'
is_etable128[51,2] = 'R'
is_etable128[51,3] = 'R'
is_etable128[51,4] = '50'
is_etable128[51,5] = '231131'
is_etable128[51,6] = 'bbsssbsbbbs'
is_etable128[52,1] = '51'
is_etable128[52,2] = 'S'
is_etable128[52,3] = 'S'
is_etable128[52,4] = '51'
is_etable128[52,5] = '213113'
is_etable128[52,6] = 'bbsbbbsbsss'
is_etable128[53,1] = '52'
is_etable128[53,2] = 'T'
is_etable128[53,3] = 'T'
is_etable128[53,4] = '52'
is_etable128[53,5] = '213311'
is_etable128[53,6] = 'bbsbbbsssbs'
is_etable128[54,1] = '53'
is_etable128[54,2] = 'U'
is_etable128[54,3] = 'U'
is_etable128[54,4] = '53'
is_etable128[54,5] = '213131'
is_etable128[54,6] = 'bbsbbbsbbbs'
end subroutine
public subroutine of_initial128_2 ();is_etable128[55,1] = '54'
is_etable128[55,2] = 'V'
is_etable128[55,3] = 'V'
is_etable128[55,4] = '54'
is_etable128[55,5] = '311123'
is_etable128[55,6] = 'bbbsbsbbsss'
is_etable128[56,1] = '55'
is_etable128[56,2] = 'W'
is_etable128[56,3] = 'W'
is_etable128[56,4] = '55'
is_etable128[56,5] = '311321'
is_etable128[56,6] = 'bbbsbsssbbs'
is_etable128[57,1] = '56'
is_etable128[57,2] = 'X'
is_etable128[57,3] = 'X'
is_etable128[57,4] = '56'
is_etable128[57,5] = '331121'
is_etable128[57,6] = 'bbbsssbsbbs'
is_etable128[58,1] = '57'
is_etable128[58,2] = 'Y'
is_etable128[58,3] = 'Y'
is_etable128[58,4] = '57'
is_etable128[58,5] = '312113'
is_etable128[58,6] = 'bbbsbbsbsss'
is_etable128[59,1] = '58'
is_etable128[59,2] = 'Z'
is_etable128[59,3] = 'Z'
is_etable128[59,4] = '58'
is_etable128[59,5] = '312311'
is_etable128[59,6] = 'bbbsbbsssbs'
is_etable128[60,1] = '59'
is_etable128[60,2] = '['
is_etable128[60,3] = '['
is_etable128[60,4] = '59'
is_etable128[60,5] = '332111'
is_etable128[60,6] = 'bbbsssbbsbs'
is_etable128[61,1] = '60'
is_etable128[61,2] = '\'
is_etable128[61,3] = '\'
is_etable128[61,4] = '60'
is_etable128[61,5] = '314111'
is_etable128[61,6] = 'bbbsbbbbsbs'
is_etable128[62,1] = '61'
is_etable128[62,2] = ']'
is_etable128[62,3] = ']'
is_etable128[62,4] = '61'
is_etable128[62,5] = '221411'
is_etable128[62,6] = 'bbssbssssbs'
is_etable128[63,1] = '62'
is_etable128[63,2] = '^'
is_etable128[63,3] = '^'
is_etable128[63,4] = '62'
is_etable128[63,5] = '431111'
is_etable128[63,6] = 'bbbbsssbsbs'
is_etable128[64,1] = '63'
is_etable128[64,2] = '_'
is_etable128[64,3] = '_'
is_etable128[64,4] = '63'
is_etable128[64,5] = '111224'
is_etable128[64,6] = 'bsbssbbssss'
is_etable128[65,1] = '64'
is_etable128[65,2] = 'NUL'
is_etable128[65,3] = '`'
is_etable128[65,4] = '64'
is_etable128[65,5] = '111422'
is_etable128[65,6] = 'bsbssssbbss'
is_etable128[66,1] = '65'
is_etable128[66,2] = 'SOH'
is_etable128[66,3] = 'a'
is_etable128[66,4] = '65'
is_etable128[66,5] = '121124'
is_etable128[66,6] = 'bssbsbbssss'
is_etable128[67,1] = '66'
is_etable128[67,2] = 'STX'
is_etable128[67,3] = 'b'
is_etable128[67,4] = '66'
is_etable128[67,5] = '121421'
is_etable128[67,6] = 'bssbssssbbs'
is_etable128[68,1] = '67'
is_etable128[68,2] = 'ETX'
is_etable128[68,3] = 'c'
is_etable128[68,4] = '67'
is_etable128[68,5] = '141122'
is_etable128[68,6] = 'bssssbsbbss'
is_etable128[69,1] = '68'
is_etable128[69,2] = 'EOT'
is_etable128[69,3] = 'd'
is_etable128[69,4] = '68'
is_etable128[69,5] = '141221'
is_etable128[69,6] = 'bssssbssbbs'
is_etable128[70,1] = '69'
is_etable128[70,2] = 'ENQ'
is_etable128[70,3] = 'e'
is_etable128[70,4] = '69'
is_etable128[70,5] = '112214'
is_etable128[70,6] = 'bsbbssbssss'
is_etable128[71,1] = '70'
is_etable128[71,2] = 'ACK'
is_etable128[71,3] = 'f'
is_etable128[71,4] = '70'
is_etable128[71,5] = '112412'
is_etable128[71,6] = 'bsbbssssbss'
is_etable128[72,1] = '71'
is_etable128[72,2] = 'BEL'
is_etable128[72,3] = 'g'
is_etable128[72,4] = '71'
is_etable128[72,5] = '122114'
is_etable128[72,6] = 'bssbbsbssss'
is_etable128[73,1] = '72'
is_etable128[73,2] = 'BS'
is_etable128[73,3] = 'h'
is_etable128[73,4] = '72'
is_etable128[73,5] = '122411'
is_etable128[73,6] = 'bssbbssssbs'
is_etable128[74,1] = '73'
is_etable128[74,2] = 'HT'
is_etable128[74,3] = 'i'
is_etable128[74,4] = '73'
is_etable128[74,5] = '142112'
is_etable128[74,6] = 'bssssbbsbss'
is_etable128[75,1] = '74'
is_etable128[75,2] = 'LF'
is_etable128[75,3] = 'j'
is_etable128[75,4] = '74'
is_etable128[75,5] = '142211'
is_etable128[75,6] = 'bssssbbssbs'
is_etable128[76,1] = '75'
is_etable128[76,2] = 'VT'
is_etable128[76,3] = 'k'
is_etable128[76,4] = '75'
is_etable128[76,5] = '241211'
is_etable128[76,6] = 'bbssssbssbs'
is_etable128[77,1] = '76'
is_etable128[77,2] = 'FF'
is_etable128[77,3] = 'I'
is_etable128[77,4] = '76'
is_etable128[77,5] = '221114'
is_etable128[77,6] = 'bbssbsbssss'
is_etable128[78,1] = '77'
is_etable128[78,2] = 'CR'
is_etable128[78,3] = 'm'
is_etable128[78,4] = '77'
is_etable128[78,5] = '413111'
is_etable128[78,6] = 'bbbbsbbbsbs'
is_etable128[79,1] = '78'
is_etable128[79,2] = 'SO'
is_etable128[79,3] = 'n'
is_etable128[79,4] = '78'
is_etable128[79,5] = '241112'
is_etable128[79,6] = 'bbssssbsbss'
is_etable128[80,1] = '79'
is_etable128[80,2] = 'SI'
is_etable128[80,3] = 'o'
is_etable128[80,4] = '79'
is_etable128[80,5] = '134111'
is_etable128[80,6] = 'bsssbbbbsbs'
is_etable128[81,1] = '80'
is_etable128[81,2] = 'DLE'
is_etable128[81,3] = 'p'
is_etable128[81,4] = '80'
is_etable128[81,5] = '111242'
is_etable128[81,6] = 'bsbssbbbbss'
is_etable128[82,1] = '81'
is_etable128[82,2] = 'DC1'
is_etable128[82,3] = 'q'
is_etable128[82,4] = '81'
is_etable128[82,5] = '121142'
is_etable128[82,6] = 'bssbsbbbbss'
is_etable128[83,1] = '82'
is_etable128[83,2] = 'DC2'
is_etable128[83,3] = 'r'
is_etable128[83,4] = '82'
is_etable128[83,5] = '121241'
is_etable128[83,6] = 'bssbssbbbbs'
is_etable128[84,1] = '83'
is_etable128[84,2] = 'DC3'
is_etable128[84,3] = 's'
is_etable128[84,4] = '83'
is_etable128[84,5] = '114212'
is_etable128[84,6] = 'bsbbbbssbss'
is_etable128[85,1] = '84'
is_etable128[85,2] = 'DC4'
is_etable128[85,3] = 't'
is_etable128[85,4] = '84'
is_etable128[85,5] = '124112'
is_etable128[85,6] = 'bssbbbbsbss'
is_etable128[86,1] = '85'
is_etable128[86,2] = 'NAK'
is_etable128[86,3] = 'u'
is_etable128[86,4] = '85'
is_etable128[86,5] = '124211'
is_etable128[86,6] = 'bssbbbbssbs'
is_etable128[87,1] = '86'
is_etable128[87,2] = 'SYN'
is_etable128[87,3] = 'v'
is_etable128[87,4] = '86'
is_etable128[87,5] = '411212'
is_etable128[87,6] = 'bbbbsbssbss'
is_etable128[88,1] = '87'
is_etable128[88,2] = 'ETB'
is_etable128[88,3] = 'w'
is_etable128[88,4] = '87'
is_etable128[88,5] = '421112'
is_etable128[88,6] = 'bbbbssbsbss'
is_etable128[89,1] = '88'
is_etable128[89,2] = 'CAN'
is_etable128[89,3] = 'x'
is_etable128[89,4] = '88'
is_etable128[89,5] = '421211'
is_etable128[89,6] = 'bbbbssbssbs'
is_etable128[90,1] = '89'
is_etable128[90,2] = 'EM'
is_etable128[90,3] = 'y'
is_etable128[90,4] = '89'
is_etable128[90,5] = '212141'
is_etable128[90,6] = 'bbsbbsbbbbs'
is_etable128[91,1] = '90'
is_etable128[91,2] = 'SUB'
is_etable128[91,3] = 'z'
is_etable128[91,4] = '90'
is_etable128[91,5] = '214121'
is_etable128[91,6] = 'bbsbbbbsbbs'
is_etable128[92,1] = '91'
is_etable128[92,2] = 'ESC'
is_etable128[92,3] = '{'
is_etable128[92,4] = '91'
is_etable128[92,5] = '412121'
is_etable128[92,6] = 'bbbbsbbsbbs'
is_etable128[93,1] = '92'
is_etable128[93,2] = 'FS'
is_etable128[93,3] = '|'
is_etable128[93,4] = '92'
is_etable128[93,5] = '111143'
is_etable128[93,6] = 'bsbsbbbbsss'
is_etable128[94,1] = '93'
is_etable128[94,2] = 'GS'
is_etable128[94,3] = '}'
is_etable128[94,4] = '93'
is_etable128[94,5] = '111341'
is_etable128[94,6] = 'bsbsssbbbbs'
is_etable128[95,1] = '94'
is_etable128[95,2] = 'RS'
is_etable128[95,3] = '~~'
is_etable128[95,4] = '94'
is_etable128[95,5] = '131141'
is_etable128[95,6] = 'bsssbsbbbbs'
is_etable128[96,1] = '95'
is_etable128[96,2] = 'US'
is_etable128[96,3] = 'DEL'
is_etable128[96,4] = '95'
is_etable128[96,5] = '114113'
is_etable128[96,6] = 'bsbbbbsbsss'
is_etable128[97,1] = '96'
is_etable128[97,2] = 'FNC3'
is_etable128[97,3] = 'FNC3'
is_etable128[97,4] = '96'
is_etable128[97,5] = '114311'
is_etable128[97,6] = 'bsbbbbsssbs'
is_etable128[98,1] = '97'
is_etable128[98,2] = 'FNC2'
is_etable128[98,3] = 'FNC2'
is_etable128[98,4] = '97'
is_etable128[98,5] = '411113'
is_etable128[98,6] = 'bbbbsbsbsss'
is_etable128[99,1] = '98'
is_etable128[99,2] = 'SHIFT'
is_etable128[99,3] = 'SHIFT'
is_etable128[99,4] = '98'
is_etable128[99,5] = '411311'
is_etable128[99,6] = 'bbbbsbsssbs'
is_etable128[100,1] = '99'
is_etable128[100,2] = 'CODEC'
is_etable128[100,3] = 'CODEC'
is_etable128[100,4] = '99'
is_etable128[100,5] = '113141'
is_etable128[100,6] = 'bsbbbsbbbbs'
is_etable128[101,1] = '100'
is_etable128[101,2] = 'CODEB'
is_etable128[101,3] = 'FNC4'
is_etable128[101,4] = 'CODEB'
is_etable128[101,5] = '114131'
is_etable128[101,6] = 'bsbbbbsbbbs'
is_etable128[102,1] = '101'
is_etable128[102,2] = 'FNC4'
is_etable128[102,3] = 'CODEA'
is_etable128[102,4] = 'CODEA'
is_etable128[102,5] = '311141'
is_etable128[102,6] = 'bbbsbsbbbbs'
is_etable128[103,1] = '102'
is_etable128[103,2] = 'FNC1'
is_etable128[103,3] = 'FNC1'
is_etable128[103,4] = 'FNC1'
is_etable128[103,5] = '411131'
is_etable128[103,6] = 'bbbbsbsbbbs'
is_etable128[104,1] = '103'
is_etable128[104,2] = 'StartA'
is_etable128[104,3] = 'StartA'
is_etable128[104,4] = 'StartA'
is_etable128[104,5] = '211412'
is_etable128[104,6] = 'bbsbssssbss'
is_etable128[105,1] = '104'
is_etable128[105,2] = 'StartB'
is_etable128[105,3] = 'StartB'
is_etable128[105,4] = 'StartB'
is_etable128[105,5] = '211214'
is_etable128[105,6] = 'bbsbssbssss'
is_etable128[106,1] = '105'
is_etable128[106,2] = 'StartC'
is_etable128[106,3] = 'StartC'
is_etable128[106,4] = 'StartC'
is_etable128[106,5] = '211232'
is_etable128[106,6] = 'bbsbssbbbss'
is_etable128[107,1] = '106'
is_etable128[107,2] = 'Stop'
is_etable128[107,3] = 'Stop'
is_etable128[107,4] = 'Stop'
is_etable128[107,5] = '2331112'
is_etable128[107,6] = 'bbsssbbbsbsbb'
end subroutine
public function string of_get_etable128 (string as_str, integer ai_query_index, integer ai_return_index);int li_for
long ll_number
string ls_return = ''
for li_for = 1 to upperbound(is_etable128)
if is_etable128[li_for,ai_query_index] = as_str then
ls_return = is_etable128[li_for,ai_return_index]
exit
end if
next
return ls_return
end function
public subroutine of_barcode128 (string as_str, datawindow adw_dw, string as_column, long al_rgb, string as_type);//================================
//of_barcode128、Code128C奇数位取CODEA
//--------------------------------
//ls_str - 条码内容
//adw_dw - 需要绘制条码的数据窗口
//as_column - 绘制条码在 XXX 列上
//al_rgb - 条码颜色
//as_type - 条码类型(不区分大小写)
//================================
char ls_charStr[],ls_bit[],ls_char[]
string ls_arr[],ls_valueArr[]
int li_for,li_for2,li_type,li_id
string ls_str,ls_str2,ls_value,ls_type
long ll_number = 0
int li_id2,li_id3,li_index
long ll_number2
ls_str = as_str
ls_type = upper(as_type)
if isnull(ls_str) or ls_str = '' then return
choose case ls_type
case 'A','B'
li_type = 2
if ls_type = 'B' then li_type = 3
for li_for = 1 to lenW(ls_str)
ls_arr[upperbound(ls_arr) + 1] = midW(ls_str,li_for,1)
next
case 'C'
li_type = 4
if mod(lenW(ls_str),2) <> 0 then
ls_str2 = rightw(ls_str,1)
ls_str = leftw(ls_str,lenW(ls_str) -1) //取偶数位
end if
for li_for = 1 to lenW(ls_str) step 2 //128C 两个两个分为一组
//01一组的 的需要去除 0
ls_value = midW(ls_str,li_for,2)
if not isnumber(ls_value) then
messagebox("提示","条码内容错误!!!")
return
end if
ls_arr[upperbound(ls_arr) + 1] = string(integer(ls_value))
next
case else
messagebox("提示","条码类型错误!!!")
return
end choose
adw_dw.setredraw(false)
of_reset(adw_dw) //清除线条
//===================================================
//起始位
ls_valueArr[upperbound(ls_valueArr) + 1] = of_get_etable128('Start' + ls_type,li_type,6)
//数据位、每个字符获取对应编码
for li_for = 1 to upperbound(ls_arr)
ls_value = of_get_etable128(ls_arr[li_for],li_type,6)
li_id = integer(of_get_etable128(ls_arr[li_for],li_type,1))
if ls_value = '' or isnull(ls_value) then
messagebox("提示","条码内容错误!!!")
adw_dw.setredraw(true)
return
end if
ll_number = ll_number + (li_id * li_for)
ls_valueArr[upperbound(ls_valueArr) + 1] = ls_value
next
//数据位code128C 奇数位
if ls_type = 'C' then
li_id2 = integer(of_get_etable128('CODEA',li_type,1)) //CODEA的id
li_id3 = integer(of_get_etable128(ls_str2,2,1)) //Code128A中ls_str2的id
li_index = (lenw(ls_str)/2)
ls_value = of_get_etable128('CODEA',li_type,6)
ls_valueArr[upperbound(ls_valueArr) + 1] = ls_value
ls_value = of_get_etable128(ls_str2,2,6)
ls_valueArr[upperbound(ls_valueArr) + 1] = ls_value
ll_number = ll_number + (li_id2 * (li_index + 1)) + (li_id3 * (li_index + 2))
end if
//检验位
li_id = integer(of_get_etable128('Start' + ls_type,li_type,1))
ll_number = li_id + ll_number
ll_number = mod(ll_number,103)
ls_valueArr[upperbound(ls_valueArr) + 1] = of_get_etable128(string(ll_number),1,6) //根据ID返回编码
//停止位
ls_valueArr[upperbound(ls_valueArr) + 1] = of_get_etable128('Stop',li_type,6)
//===================================================
//===================================================
//绘制条码 || 字段作用只是确认X、Y坐标和高度、宽度不适用
long ll_width,ll_height
long ll_y,ll_x,ll_x2,ll_y2,ll_color
string ls_name,ls_band
ls_band = adw_dw.describe(as_column + ".band")
ll_x = long(adw_dw.describe(as_column+".x"))
ll_y = long(adw_dw.describe(as_column+".y"))
ll_height = long(adw_dw.describe(as_column+".height"))
ll_x2 = ll_x
ll_y2 = ll_y + ll_height
for li_for = 1 to upperbound(ls_valueArr)
ls_char = ls_valueArr[li_for]
for li_for2 = 1 to upperbound(ls_char)
ls_value = ls_char[li_for2]
if ls_value = 'b' then
ll_color = al_rgb
else
ll_color = 16777215 //白色
end if
ls_name = 'l_' + string(li_for) + '_' + string(li_for2)
is_arrLine[upperbound(is_arrLine) + 1] = ls_name
adw_dw.Modify('create line(band='+ ls_band +' x1="'+string(ll_x2)+'" y1="'+string(ll_y)+'" x2="'+string(ll_x2)+'" y2="'+string(ll_y2)+'" name='+ls_name+' visible="1" pen.style="0" pen.width="'+string(ii_linew)+'" pen.color="'+string(ll_color)+'" background.mode="2" background.color="1073741824" )')
ll_x2 = ll_x2 + ii_linew
next
next
adw_dw.setredraw(true)
end subroutine
on uo_barcode.create
call super::create
TriggerEvent( this, "constructor" )
end on
on uo_barcode.destroy
TriggerEvent( this, "destructor" )
call super::destroy
end on
event constructor;of_initial()
of_initial128_1()
of_initial128_2()
end event