Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printing UPC Code 128 Barcodes
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01320633
Message ID:
01320666
Views:
12
>I am having some trouble getting some very simple Code 128 barcodes to print correctly. It looks like an extraneous character is being added to the front of the barcode image. You can see an example of what I am talking about at:
>
>http://www.edssolutions.net/barcode.htm
>
>Because this extraneous character occurs at the front of the barcode, it leads me to suspect the checksum program I am using (which I copied and pasted from a thread in this forum :-) ).
>
>Here is the code:
>
>
>Parameters l_in
>
>z=104
>
>For q=1 To Len(l_in)
>	Y=Asc(Subs(l_in,q,1))-32
>	z=z+Y*q
>Endfor
>
>z=Mod(z,103)
>
>Do Case
>	Case z=0
>		Return Chr(162)+l_in+Chr(174)+Chr(164)
>	Case z<94
>		Return Chr(162)+l_in+Chr(z+32)+Chr(164)
>	Otherwise
>		Return Chr(162)+l_in+Chr(z+71)+Chr(164)
>Endcase
>
>
>Is the CHR(162) character that is being appended to the front of the string correct? Could it possibly be my font that is the culprit? I have tried several different Code 128 fonts, but all give the same results.
>
>Anyone have any insight into this behavior?

Looks as if this example is for a specific application or font. Firstly the 'z=104' implies that this is a CodeB barcode - which may or may not be the case for you. The addition of the CHR(162) and CHR(164) is almost certainly font/application specific - nothing to do with basic CODE128 structure. Also, if the StartCode is already part of the input parameter the FOR loop should start at 2 not 1. Can you give an example of the l_in content?

Regards,
Viv
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform