水晶报表中用Code128制作条型码的方法
--
Function fncGetCd128SetB ( strIn As string ) As String
Dim intLoop As Number
Dim intPosition as Number
Dim intTotalVal as Number
Dim strOut as String
Dim strSpChr as String
Dim strEndChr as String
Dim intEndNo as Number
strOut = ""
for intLoop = 0 to Len(strIn) - 1
intPosition = intLoop + 1
strSpChr = Mid(strIn, intPosition, 1)
intTotalVal = intTotalVal + (Asc(strSpChr) - 32) * intPosition
next
intTotalVal = intTotalVal + 104
intTotalVal = intTotalVal mod 103
If intTotalVal >= 95 Then
Select Case intTotalVal
Case 95
strEndChr = "Ã"
Case 96
strEndChr = "Ä"
Case 97
strEndChr = "Å"
Case 98
strEndChr = "Æ"
Case 99
strEndChr = "Ç"
Case 100
strEndChr = "È"
Case 101
strEndChr = "É"
Case 102
strEndChr = "Ê"
End Select
Else
intTotalVal = intTotalVal + 32
strEndChr = Chr(intTotalVal)
End If
fncGetCd128SetB = "Ì" + strIn + strEndChr + "Î"
End Function
沒有留言:
張貼留言