和窄间隙宽度 Dim intIndex As Integer 注释: 当前处理的字符串索引 Dim i As Integer, j As Integer, k As Integer 注释: 循环控制变量 注释: 添加起始字符 If Left(strBC, 1) <> "*" Then strBC = "*" & strBC End If 注释: 添加结束字符 If Right(strBC, 1) <> "*" Then strBC = strBC & "*" End If 注释: 循环处理每个要显示的条码字符 For i = 1 To Len(strBC) 注释: 确定当前字符在 strBarTable 中的索引 Select Case Mid(strBC, i, 1) Case "*" intIndex = 39 Case "contentquot; intIndex = 38 Case "%" intIndex = 37 Case "-" intIndex = 36 Case "0" To "9" intIndex = CInt(Mid(strBC, i, 1)) Case "A" To "Z" intIndex = Asc(Mid(strBC, i, 1)) - Asc("A") + 10 Case Else MsgBox "要打印的条形码字符串中包含无效字符!当前版本只支持字符 注释:0注释:-注释:9注释:,注释:A注释:-注释:Z注释:,注释:-注释:,注释:%注释:,注释:$注释:和注释:*注释:" End Select 注释: 是否在条形码下方打印人工识别字符 If bolPrintText = True Then Printer.CurrentX = x Printer.CurrentY = y + intHeight Printer.Print Mid(strBC, i, 1) End If For j = 1 To 5 注释: 画细线 If Mid(strBarTable(intIndex), j, 1) = "0" Then For k = 0 To intWidthXI - 1 Printer.Line (x + k, y)-Step(0, intHeight) Next k x = x + intWidthXI 注释: 画宽线 Else For k = 0 To intWidthCU - 1 Printer.Line (x + k, y)-Step(0, intHeight) Next k x = x + intWidthCU End If 注释: 每个字符条码之间为窄间隙 If j = 5 Then x = x + intWidthXI * 3 Exit For End If 注释: 窄间隙 If Mid(strBarTable(intIndex), j + 5, 1) = "0" Then x = x + intWidthXI * 3 注释: 宽间隙