This site will look much better in a browser that supports web standards, but it is accessible to any browser or Internet device.

bar code software

Azalea Software, Inc.


Printing Bookland Bar Codes in Visual Basic

The following functions can be used within Microsoft Visual Basic to create and print Bookland barcodes using Azalea Software's barcode fonts. Other functions are available for UPC, Code 128, Code 39, and Interleaved 2 of 5.

These functions can be ported to other languages and development tools. Copy, paste, and edit the code as needed. Our copyright notice must remain intact. When you port, please send us a copy so we can learn something new. AtDhVaAnNkCsE

This sample code is provided as is. While every attempt has been made to insure that it works correctly, please double-check it against the results obtained from our bundled wizard utility. Please report any bugs or problems.

Function AzaleaBookland(byVal ISBNnumber as String, ByVal fiveDigitSuppl as String) as String
' UPCTools v5.0 9.10.00 jwhiting
' Copyright 2000 Jerry Whiting. All rights reserved.
' Azalea Software, Inc. www.azalea.com

  ' The input, ISBNnumber, is the 10-digit ISBN number.
  ' The input, fiveDigitSuppl, is the 5 digit supplemental number.
  ' Format the output, AzaleaBookland, using an Azalea Software, Inc. barcode font.
  ' Note that this routine requires the EvenS, OddS, EvenBar, & OddBar functions.

  Dim ISBN As String ' for the ISBN string
  Dim checkDigitSubtotal as integer ' reset-able throw-away variable
  Dim checkDigit As String ' reset-able check digit itself
  Dim temp As String ' throw-away variable

  ISBN = "978" + Left$(ISBNnumber, 9)

  ' do the EAN-13 check digit
  checkDigitSubtotal = 3 * (Val(Mid$(ISBN, 2, 1)) + Val(Mid$(ISBN, 4, 1)) + Val(Mid$(ISBN, 6, 1)) + Val(Mid$(ISBN, 8, 1)) + Val(Mid$(ISBN, 10, 1)) + Val(Right$(ISBN, 1)))
  checkDigitSubtotal = checkDigitSubtotal + Val(Left$(ISBN, 1)) + Val(Mid$(ISBN, 3, 1)) + Val(Mid$(ISBN, 5, 1)) + Val(Mid$(ISBN, 7, 1)) + Val(Mid$(ISBN, 9, 1)) + Val(Mid$(ISBN, 11, 1))
  checkDigit = Right$(Str$(300 - checkDigitSubtotal), 1)


  ' Bookland symbols using a 10-digit ISBN begin with right guard bar & '978'
  ' supplemental bars always start with "v"
  temp = Chr$(170) + "|xHS" + EvenBar(Mid$(ISBN, 4, 1))
  temp = temp + OddBar(Mid$(ISBN, 5, 1))
  temp = temp + EvenBar(Mid$(ISBN, 6, 1))
  temp = temp + OddBar(Mid$(ISBN, 7, 1)) + "y" + Right$(ISBN, 5) + checkDigit + "zv"

  ' do the 5-digit suppl check digit
  checkDigitSubtotal = 3 * (Val(Left$(fiveDigitSuppl, 1)) + Val(Mid$(fiveDigitSuppl, 3, 1)) + Val(Right$(fiveDigitSuppl, 1)))
  checkDigitSubtotal = checkDigitSubtotal + (9 * (Val(Mid$(fiveDigitSuppl, 2, 1)) + Val(Mid$(fiveDigitSuppl, 4, 1))))
  checkDigit = Right$(Str$(checkDigitSubtotal), 1)

  'the rest of the output depends on the checkDigit value
  Select Case checkDigit
    Case "0" ' EEEOO
      temp = temp + EvenS(Left$(fiveDigitSuppl, 1)) + ":" + EvenS(Mid$(fiveDigitSuppl, 2, 1))
      Bookland = temp + ":" + OddS(Mid$(fiveDigitSuppl, 3, 1)) + ":" + OddS(Mid$(fiveDigitSuppl, 4, 1)) + ":" + OddS(Right$(fiveDigitSuppl, 1))
    Case "1" ' EOEOO
      temp = temp + EvenS(Left$(fiveDigitSuppl, 1)) + ":" + OddS(Mid$(fiveDigitSuppl, 2, 1))
      Bookland = temp + ":" + EvenS(Mid$(fiveDigitSuppl, 3, 1)) + ":" + OddS(Mid$(fiveDigitSuppl, 4, 1)) + ":" + OddS(Right$(fiveDigitSuppl, 1))
    Case "2" ' EOOEO
      temp = temp + EvenS(Left$(fiveDigitSuppl, 1)) + ":" + OddS(Mid$(fiveDigitSuppl, 2, 1))
      Bookland = temp + ":" + OddS(Mid$(fiveDigitSuppl, 3, 1)) + ":" + EvenS(Mid$(fiveDigitSuppl, 4, 1)) + ":" + OddS(Right$(fiveDigitSuppl, 1))
    Case "3" ' EOOOE
      temp = temp + EvenS(Left$(fiveDigitSuppl, 1)) + ":" + OddS(Mid$(fiveDigitSuppl, 2, 1))
      Bookland = temp + ":" + OddS(Mid$(fiveDigitSuppl, 3, 1)) + ":" + OddS(Mid$(fiveDigitSuppl, 4, 1)) + ":" + EvenS(Right$(fiveDigitSuppl, 1))
    Case "4" ' OEEOO
      temp = temp + OddS(Left$(fiveDigitSuppl, 1)) + ":" + EvenS(Mid$(fiveDigitSuppl, 2, 1))
      Bookland = temp + ":" + EvenS(Mid$(fiveDigitSuppl, 3, 1)) + ":" + OddS(Mid$(fiveDigitSuppl, 4, 1)) + ":" + OddS(Right$(fiveDigitSuppl, 1))
    Case "5" ' OOEEO
      temp = temp + OddS(Left$(fiveDigitSuppl, 1)) + ":" + OddS(Mid$(fiveDigitSuppl, 2, 1))
      Bookland = temp + ":" + EvenS(Mid$(fiveDigitSuppl, 3, 1)) + ":" + EvenS(Mid$(fiveDigitSuppl, 4, 1)) + ":" + OddS(Right$(fiveDigitSuppl, 1))
    Case "6" ' OOOEE
      temp = temp + OddS(Left$(fiveDigitSuppl, 1)) + ":" + OddS(Mid$(fiveDigitSuppl, 2, 1))
      Bookland = temp + ":" + OddS(Mid$(fiveDigitSuppl, 3, 1)) + ":" + EvenS(Mid$(fiveDigitSuppl, 4, 1)) + ":" + EvenS(Right$(fiveDigitSuppl, 1))
    Case "7" ' OEOEO
      temp = temp + OddS(Left$(fiveDigitSuppl, 1)) + ":" + EvenS(Mid$(fiveDigitSuppl, 2, 1))
      Bookland = temp + ":" + OddS(Mid$(fiveDigitSuppl, 3, 1)) + ":" + EvenS(Mid$(fiveDigitSuppl, 4, 1)) + ":" + OddS(Right$(fiveDigitSuppl, 1))
    Case "8" ' OEOOE
      temp = temp + OddS(Left$(fiveDigitSuppl, 1)) + ":" + EvenS(Mid$(fiveDigitSuppl, 2, 1))
      Bookland = temp + ":" + OddS(Mid$(fiveDigitSuppl, 3, 1)) + ":" + OddS(Mid$(fiveDigitSuppl, 4, 1)) + ":" + EvenS(Right$(fiveDigitSuppl, 1))
    Case "9" ' OOEOE
      temp = temp + OddS(Left$(fiveDigitSuppl, 1)) + ":" + OddS(Mid$(fiveDigitSuppl, 2, 1))
      Bookland = temp + ":" + EvenS(Mid$(fiveDigitSuppl, 3, 1)) + ":" + OddS(Mid$(fiveDigitSuppl, 4, 1)) + ":" + EvenS(Right$(fiveDigitSuppl, 1))
  End Select

' Format the output, Bookland, using an Azalea Software, Inc. barcode font.

End Function

===

Private Function OddS(ByVal theString as String) as String
' UPCTools v5.0 9.10.00 jwhiting
' Copyright 2000 Jerry Whiting. All rights reserved.
' Azalea Software, Inc. www.azalea.com
' called by 2Suppl, 5Suppl, Bookland, & ISSN
  Select Case theString
    Case "0"
      OddS = "!"
    Case "1"
      OddS = Chr$(34)
    Case "2"
      OddS = "#"
    Case "3"
      OddS = "$"
    Case "4"
      OddS = "%"
    Case "5"
      OddS = "&"
    Case "6"
      OddS = "'"
    Case "7"
      OddS = "("
    Case "8"
      OddS = ")"
    Case "9"
      OddS = "*"
  End Select

End Function

===

Private Function EvenS(ByVal theString as String) as String
' UPCTools v5.0 9.10.00 jwhiting
' Copyright 2000 Jerry Whiting. All rights reserved.
' Azalea Software, Inc. www.azalea.com
' called by 2Suppl, 5Suppl, Bookland, & ISSN
  Select Case theString
    Case "0"
      EvenS = "+"
    Case "1"
      EvenS = ","
    Case "2"
      EvenS = "-"
    Case "3"
      EvenS = "."
    Case "4"
      EvenS = "/"
    Case "5"
      EvenS = ";"
    Case "6"
      EvenS = "<"
    Case "7"
      EvenS = "="
    Case "8"
    EvenS = ">"
    Case "9"
      EvenS = "^"
  End Select
End Function

===

Private Static Function OddBar(ByVal theString as String) as String
' UPCTools v5.0 9.10.00 jwhiting
' Copyright 2000 Jerry Whiting. All rights reserved.
' Azalea Software, Inc. www.azalea.com
' called by AzaleaEAN13, AzaleaEAN8, AzaleaBookland, AzaleaISSN, & AzaleaUPCverE
  OddBar = Chr$(65 + (Val(theString)))
End Function

===

Private Static Function EvenBar(ByVal theString as String) as String
' UPCTools v5.0 9.10.00 jwhiting
' Copyright 2000 Jerry Whiting. All rights reserved.
' Azalea Software, Inc. www.azalea.com
' called by AzaleaEAN13, AzaleaBookland, AzaleaISSN, & AzaleaUPCverE
  EvenBar = Chr$(75 + Val(theString))
End Function


contact ustechnical supportabout usour blogsite mapmisc.links