Need To Create A Custom Check Digit S’abonner

0
Avatar
Legacy Poster

Hello,  do to one of customer requirements I need to create a custom check digit when printing a bar code.  I scanned thru the forums and found this code that might work for us.   But when I try to run it I get a 

If somebody code tell me what that doing I would appreciate it. 

I tried different things but cannot seem to get past it.   

I really need to work in Version 8,   but I am testing in Version 10.

Thanks.

Terry

 

Type Mismatch  'MyMod'   at line 22.  

 

Dim result, k, lett, calc, lenIni
 
result = "aaavh"
'Replaces the characters "." and "-" if entered.
result = Replace (result,"-","")
result = Replace(result,".","99")
 
k = 1
lenIni = Len(result)
While k <= lenIni
    lett = Mid(result, k, 1)
    
    'Replaces alpha values by its position in the ASCII table.
    If (Not IsNumeric(lett)) Then
        result = Replace (result, lett, CStr(Asc(lett)-55))
        lenIni = lenIni + (Len(result)-lenIni)
    End If
    k = k + 1
WEnd
 
'Algorithm applied over resulting value.
calc = MyMod(MyMod(CDbl(result)*100, 97), 97)
 

Value = Right(calc,2) 

Vous devez vous connecter pour laisser un commentaire.