
- 164 -
3. Intherightsideofthedialogboxselectalreadyprepareddataconnectionorcreateanew
one.
4. OnceyouhavetheODBCdataconnectionprepared,selectitandclosethedialog.
5. Thefieldsfromtheselecteddatabasecannowbeusedonthelabel.
Creating Custom Check Digit
Creating Custom Check Digit
Youcanaddneworeditanddeleteexistingalgorithmsbyclickingappropriatebuttons.Algorithm's
parametersaredefinedinEditalgorithmdialogbox,whichhasfollowingoptions:
Editingcheckdigitalgorithm
Tounderstandallparameters,youmustknow,howcheckdigitiscalculated.Firstofall,wemust
haveanumericvalueandontopofthatthecheckdigitwillbecalculated.Ifweightsarerequired,
wewillneedthemaswell.Let'slookatEAN13checkdigitcalculation:
Value:123456789012
Weights:1,3
Whenstartingcalculating,eachdigithasitsweight.Whenonlytwoweightsarespecified,thethird
digitgetsthefirstweight,theforththesecond,andsoon.Ifonlyoneweightisspecified,alldigits
havethesameweight.AccordingtoSumdetermination,wecanuseweights(sumoftheproducts)or
not(sumofthedigits).EAN13algorithmusesproducts,sowedefineSumoftheproducts.
Thesumis:1×1+2×3+3×1+4×3+5×1+.....+2×3
Whenthesumiscalculated,wetakemodulusparameteranddividethesumwiththatnumberand
remembertheremainderofdivision.Thiscanalreadybetheresult.
IfResultcomplementedisspecified,wesubtracttheresultfrommodulusandsowegetthenew
value.Whenthisvalueislessthan10,wealreadygotcheckdigit.Ifitisgreatervalue(twodigits),
wetakethewholevalueorjusttheleastsignificantdigit(Onedigitonly)astheresultofcheckdigit
algorithm.
Komentáře k této Příručce