Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info
titleGenetate_EAN13

Generate_EAN13({CodeArticle.CodeEAN})


Info
titleGenetate_EAN13

Image Added


Function (StringVar input)
NumberVar checkDigitSubtotal;
StringVar checkDigit;
StringVar temp;

checkDigitSubtotal := 3 * (Val(input[2]) + Val(input[4]) + Val(input[6]) + Val(input[8]) + Val(input[10]) + Val(Right(input, 1)));
checkDigitSubtotal := checkDigitSubtotal + Val(input[1]) + Val(input[3]) + Val(input[5]) + Val(input[7]) + Val(input[9]) + Val(input[11]);
checkDigit := Right(ToText(300 - checkDigitSubtotal,"#"), 1);

Select input[1]
Case "0" :
temp := "U|x" + Chr(65 + Val(input[2]))
+ Chr(65 + Val(input[3]))
+ Chr(65 + Val(input[4]))
+ Chr(65 + Val(input[5]))
+ Chr(65 + Val(input[6]))
+ Chr(65 + Val(input[7]))
Case "1" :
temp := "[|x" + Chr(65 + Val(input[2]))
+ Chr(65 + Val(input[3]))
+ Chr(75 + Val(input[4]))
+ Chr(65 + Val(input[5]))
+ Chr(75 + Val(input[6]))
+ Chr(75 + Val(input[7]))
Case "2" :
temp := "V|x" + Chr(65 + Val(input[2]))
+ Chr(65 + Val(input[3]))
+ Chr(75 + Val(input[4]))
+ Chr(75 + Val(input[5]))
+ Chr(65 + Val(input[6]))
+ Chr(75 + Val(input[7]))
Case "3" :
temp := "W|x" + Chr(65 + Val(input[2]))
+ Chr(65 + Val(input[3]))
+ Chr(75 + Val(input[4]))
+ Chr(75 + Val(input[5]))
+ Chr(75 + Val(input[6]))
+ Chr(65 + Val(input[7]))
Case "4" :
temp := "X|x" + Chr(65 + Val(input[2]))
+ Chr(75 + Val(input[3]))
+ Chr(65 + Val(input[4]))
+ Chr(65 + Val(input[5]))
+ Chr(75 + Val(input[6]))
+ Chr(75 + Val(input[7]))
Case "5" :
temp := "Y|x" + Chr(65 + Val(input[2]))
+ Chr(75 + Val(input[3]))
+ Chr(75 + Val(input[4]))
+ Chr(65 + Val(input[5]))
+ Chr(65 + Val(input[6]))
+ Chr(75 + Val(input[7]))
Case "6" :
temp := "Z|x" + Chr(65 + Val(input[2]))
+ Chr(75 + Val(input[3]))
+ Chr(75 + Val(input[4]))
+ Chr(75 + Val(input[5]))
+ Chr(65 + Val(input[6]))
+ Chr(65 + Val(input[7]))
Case "7" :
temp := "u|x" + Chr(65 + Val(input[2]))
+ Chr(75 + Val(input[3]))
+ Chr(65 + Val(input[4]))
+ Chr(75 + Val(input[5]))
+ Chr(65 + Val(input[6]))
+ Chr(75 + Val(input[7]))
Case "8" :
temp := "\|x" + Chr(65 + Val(input[2]))
+ Chr(75 + Val(input[3]))
+ Chr(65 + Val(input[4]))
+ Chr(75 + Val(input[5]))
+ Chr(75 + Val(input[6]))
+ Chr(65 + Val(input[7]))
Case "9" :
temp := "]|x" + Chr(65 + Val(input[2]))
+ Chr(75 + Val(input[3]))
+ Chr(75 + Val(input[4]))
+ Chr(65 + Val(input[5]))
+ Chr(75 + Val(input[6]))
+ Chr(65 + Val(input[7]));

temp + "y" + Mid(input, 8, 5) + checkDigit + "z"

...

Page Properties
hiddentrue


Demandes liées