I'm throwing this together on a whim, so I hope it works right for you. You 
can have as many digits as you want and decipher them
any way you need to. The key deciding how you want to encode and decode the 
values.

ASCII 0-9 =
x30 to x39
 48 to 57

ASCII A-Z =
x41 to x5A
 65 to 90

!Build a base36 translation map
 FOR X = 1 TO 10
  MAP<X> = SEQ(X-1)
 NEXT X
 FOR X = 11 TO 36
  MAP<X> = SEQ(X+54)
 NEXT X

 0 = MAP<1> = "0"
 1 = MAP<2> = "1"
11 = MAP<11> = "A"
12 = MAP<12> = "B"


Add the first two values together to get a single decoded bit:

011 = Box   01, bag 1
AA1 = Box   20, bag 1

Use the first two values as a decoded bit pair and you get:

011 = Box   01, bag 1
AA1 = Box 1010, bag 1

LOCATE "0" IN MAP SETTING VM THEN
 DIGITVAL = VM-1; VALUE IS 0
END

LOCATE "A" IN MAP SETTING VM THEN
 DIGITVAL = VM-1; VALUE IS 10
END


Glen
http://mvdevcentral.com


> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Brutzman, Bill
> Sent: Friday, April 22, 2005 2:54 PM
> To: '[email protected]'
> Subject: [U2] Base 16, 26, 36
>
>
> We have a bar-code labeling challenge. We need to print hundreds of unique
> serialized labels.
>
> We have three characters available.
>
> I am expecting to do something like
>
> Master (pallet):  H42 2xxxxx MMM       H42 is our supplier ID.
>
> Box # 1           H42 2xxxxx AA0       2xxxxx is the six-digit packslip
> number.
> Bag # 1           H42 2xxxxx AA1
>                   H42 2xxxxx AA2
>
> Box # 2           H42 2xxxxx AB0
> Bag # 1           H42 2xxxxx AB1
>                   H42 2xxxxx AB2
>
> Z * Z = 26 * 26 = 676.  Thus, we could have up to 676 boxes.
>
> Thus on a single packing slip, we could have up to 676 boxes each having
> nine bags.
>
> It appears that UniBasic has no built-in functionality (operators) to handle
> base 26, that is, A thru Z.
>
> base 36,          A thru Z, and one thru ten.
>
> I expect that it could be done, brute force, using arrays and equates.
>
> Using Wintegrate, we write a txt-file from UniVerse to Windows.  BarTender
> (Windows-based) prints labels from the txt file.
>
> BarTender has some VB functionality that I expect we will be forced to use.
>
> I am writing because I do not want to overlook other U2 voodoo which may be
> available.
>
> Suggestions would be appreciated.
>
> --Bill
> -------
> u2-users mailing list
> [email protected]
> To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to