Description: |
Code 39 Sample Code
This sample code can be incorporated into your application as long as the copyright notice is left intact. Redistribution of Azalea Software's fonts requires a separate licensing fee.
Error checking for the correct Code 39 character set is your application’s responsibility:
Dim i as Integer
Dim yourString as String
Dim chunk as string
For i = 1 To Len(yourString) Step 1
' C39Tools v4.0 4.14.99 yazel
' Copyright 1999 Jerry Whiting. All rights reserved.
' Azalea Software, Inc. www.azalea.com
chunk$ = Mid(yourString, i, 1)
If InStr("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%", chunk) = 0 Then
' error handling
Exit Sub
End If
Next i
To do the standard 44 character version of Code 39:
Function AzaleaCode39(ByVal C39 as String) as String
' C39Tools v4.0 4.14.99 yazel
' Copyright 1999 Jerry Whiting. All rights reserved.
' Azalea Software, Inc. www.azalea.com
' The input, C39, is a string consisting of the 44-character version
' of Code 39 without the start and stop bars (*).
' Format the output, AzaleaCode39, using Azalea's Code 39 fonts.
Dim i As Integer ' loop counter
Dim chunk As String ' loop variable
Dim temp As String ' temp variable
' Because TrueType doesn't support glyphs in the space slot (ASCII 32)
' we've moved the space character to the underscore ( _ ).
' Here's the search and replace.
For i = 1 To Len(C39)
chunk$ = Mid$(C39, i, 1)
If chunk = " " Then
temp = temp + "_"
Else
temp = temp + chunk
End If
Next i
' put together the final string with the start and stop bars
AzaleaCode39 = "*" + temp + "*"
' Format the output, AzaleaCode39, using Azalea Software's Code 39 font.
' yourContainer.text = AzaleaCode39(yourString)
End Function
To do the Full ASCII version of Code 39:
Function AzaleaCode39ASCII(ByVal C39 as String) as String
' C39Tools v4.0 4.14.99 yazel
' Copyright 1999 Jerry Whiting. All rights reserved.
' Azalea Software, Inc. www.azalea.com
' The input, C39, gets mapped into the Full ASCII version of Code 39.
' Format the output, AzaleaCode39, using Azalea's Code 39 fonts.
Dim i As Integer ' loop counter
Dim chunk As String ' loop variable
Dim temp As String ' temp variable
' map into the Full ASCII version of Code 39
For i = 1 To Len(C39)
chunk = Mid(C39, i, 1)
Select Case Asc(chunk)
Case 0
temp = temp + “%U”
Case 1 To 26
temp = temp + “$” + Chr(Asc(chunk) + 64)
Case 27 To 31
temp = temp + “%” + Chr(Asc(chunk) + 38)
Case 32
' Because TrueType doesn't support glyphs in the space slot (ASCII 32)
' we've moved the space character to the underscore ( _ ).
' Here's the search and replace.
temp = temp + “_”
Case 33 To 44
temp = temp + “/” + Chr(Asc(chunk) + 32)
Case 45 To 46
temp = temp + chunk
Case 47
temp = temp + “/O”
Case 48 To 57
temp = temp + chunk
Case 58
temp = temp + “/Z”
Case 59 To 63
temp = temp + “%” + Chr(Asc(chunk) + 11)
Case 64
temp = temp + “%V”
Case 65 To 90
temp = temp + chunk
Case 91 To 95
temp = temp + “%” + Chr(Asc(chunk) - 16)
Case 96
temp = temp + “%W”
Case 97 To 122
temp = temp + “+” + Chr(Asc(chunk) - 32)
Case 123 To 126
temp = temp + “%” + Chr(Asc(chunk) - 43)
Case 127
temp = temp + “%T”
End Select
Next i
' put together the final string with the start and stop bars
AzaleaCode39ASCII = “*” + temp + “*”
' yourContainer.text = AzaleaCode39(yourString)
End Function
Code 39 is sometimes used with an optional mod 43 check digit.
Function AzaleaCode39checkDigit (ByVal C39 as String) as String
' C39Tools v4.0 2.18.98 jwhiting
' Copyright 1998 Jerry Whiting. All rights reserved.
' Azalea Software, Inc. www.azalea.com
' The input, C39, is a string consisting of the 44-character version
' of Code 39 whithout the start and stop bars (*).
' The output, AzaleaCode39checkDigit, is the input string, the mod 43
' check digit and the start and stop bars.
Dim charSet As String ' mod 43 lookup table
Dim i As Integer ' loop counter
Dim subtotal As Integer ' check digit subtotal
charSet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%"
For i = 1 To Len(C39)
subtotal = InStr(charSet, Mid(C39, i, 1)) - 1 + subtotal
Next i
' concatenate the original string, C39, and the check digit character
AzaleaCode39checkDigit = C39$ & Mid$(charSet, (subtotal Mod 43 + 1), 1)
End Function |
License Description: |
READ THIS LICENSING AGREEMENT CAREFULLY BEFORE USING A FONT FROM AZALEA SOFTWARE, INC. BY INSTALLING THIS FONT, YOU INDICATE YOUR ACCEPTANCE OF THE TERMS AND CONDITIONS OF THIS LICENSE AGREEMENT. IF YOU DO NOT ACCEPT AND AGREE TO ALL OF THE TERMS AND CONDITIONS, PROMPTLY RETURN THE UNINSTALLED FONT AND ALL RELATED MATERIALS TO THE PLACE YOU OBTAINED THEM. YOUR MONEY WILL BE RETURNED IN FULL.
Azalea Software, Inc. Licensing Agreement
1. License. Azalea Software, Inc. ("Azalea") grants you a limited license to use the enclosed font(s), associated software, user manuals, and any related materials (collectively called the "Software" in this Agreement). You may only use the Software on a single computer at any one time. You may use the Software on different computers but the same software may not be used on two or more computers simultaneously. You may not electronically transfer or share the Software from one computer to another via modem, network, or any other means.
You may make one copy of this software for backup purposes or to transfer the software to a single hard disk provided you use the original for backup purposes.
You may transfer a copy the Software and your rights under this License Agreement to a second person only if: (a) the second person agrees to all of the terms of this License Agreement; (b) you transfer the Software and documentation to the new user; (c) you erase or destroy all other copies of the Software which are in your possession or under your control; (d) you provide Azalea with thirty (30) days advance written notice of the transfer.
You may not alter, modify, translate or adapt any part of the Software or related documentation without prior written consent of Azalea. You may not disassemble, decompile, or otherwise reverse-engineer the Software, or create derivative works from it, whether in human-perceivable or machine-readable form.
This Agreement does not convey any ownership of the Software or of any copy of the Software to you, but only the right to use the Software in strict accordance with this Agreement. You acknowledge and agree that Azalea retains all title and ownership in the Software and any modifications, enhancements, updates or derivatives of the Software.
2. Proprietary Rights. The Software is the valuable trade secret property of Azalea and all Software bearing a copyright notice is, in addition, subject to the copyright laws. UNAUTHORIZED COPYING, USE, OR DISCLOSURE OF THE SOFTWARE IS AN INFRINGEMENT OF AZALEA'S COPYRIGHT AND TRADE SECRET RIGHTS. You agree that the use of a copyright notice on the Software shall not be taken to indicate that the Software has been published.
3. Money-Back Guarantee and Limited Warranty. For a period of thirty (30) days from the date of you obtained the Software, you may return the Software (including all user manuals), together with your receipt showing the amount you paid and the date you obtained the Software to the place of purchase, and obtain a full refund of the amounts you paid.
Azalea warrants that the magnetic diskette(s) on which the Software is recorded is free from defects in materials and workmanship under normal use. Azalea warrants that the Software will perform substantially in accordance with the specifications set forth in the documentation provided with the Software.
The above warranties extend for ninety (90) days from the date of original delivery to customer as the user. This warranty is made to customer if customer is the original licensed end-user. No warranty is made to any other person. Azalea does not warrant that the Software will meet customer's requirements or that the operation of the Software will not be uninterrupted or error-free. The Software warranty does not cover any Software which has been altered or changed in any way by anyone other than Azalea.
THE WARRANTIES SET FORTH ABOVE ARE IN LIEU OF ALL OTHER IMPLIED AND EXPRESS WARRANTIES, WHETHER ORAL OR WRITTEN. AZALEA DISCLAIMS ANY WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. THE AGENTS, EMPLOYEES, DISTRIBUTORS AND DEALERS OF AZALEA ARE NOT AUTHORIZED TO MAKE ANY MODIFICATIONS TO THESE WARRANTIES, NOR ADDITIONAL WARRANTIES BINDING ON AZALEA. ACCORDINGLY, ADDITIONAL STATEMENTS SUCH AS DEALER ADVERTISING OR REPRESENTATIONS, WHETHER ORAL OR WRITTEN, DO NOT CONSTITUTE WARRANTIES BY AZALEA AND SHOULD NOT BE RELIED UPON AS A WARRANTY OF AZALEA.
4. Customer Remedies and Limitations of Liability. During the warranty
period, Azalea will replace, without charge, on an exchange basis, any magnetic diskette which is not as warranted. During the warranty period, if the Software does not perform as warranted, Azalea at its sole option will (a) provide, without charge, corrected software, (b) replace, without charge, software with a functionally similar program, or (c) refund the fees paid for licensing the software. These are your sole and exclusive remedies for any breach of warranty. You must return the defective item post-paid, postmarked within the time period stated above. You must either insure the defective item being returned or assume the risk of loss or damage in transit. Address wall warranty claims to: Warranty Service Department, Azalea Software, Inc., 2728 46th Ave. SW, Seattle, WA, 98116, U.S.A. Any claim under the above warranty must include a copy of your receipt or invoice or other proof of the date of delivery. AZALEA SHALL NOT IN ANY CASE BE LIABLE FOR SPECIAL, INCIDENTAL, CONSEQUENTIAL, INDIRECT, OR OTHER DAMAGES ARISING FROM ANY BREACH OF THESE WARRANTIES, BREACH OF CONTRACT, NEGLIGENCE, OR ANY OTHER LEGAL THEORIES, EVEN IF AZALEA OR ITS AGENT HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. IN NO CASE SHALL AZALEA'S LIABILITY EXCEED THE LICENSE FEES PAID BY YOU FOR THE SOFTWARE.
5. Miscellaneous. This Agreement shall be governed by the laws of the State of Washington, U.S.A. (not including laws relating to choice of law). You and Azalea consent to the jurisdiction of and venue in the state and federal courts located in King County, Washington, U.S.A., in connection with any suit or action brought regarding the Software or this Agreement. If any legal action is brought by either party against the other regarding the subject matter of this Agreement, the prevailing party shall be entitled to recover, in addition to any other relief, reasonable attorneys' fees and expenses.
COPYRIGHT NOTICE
Copyright 1999 Jerry Whiting. Portions copyright 1999 Azalea Software, Inc. All rights reserved.
Azalea Software, Inc.
219 1st Ave. S., Suite 410
Seattle WA 98104-3415
|