<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="https://www.schweda.net/style_feed.css" ?>
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    xmlns:atom="http://www.w3.org/2005/Atom"	
	xmlns:dc="http://purl.org/dc/elements/1.1/" > 
<channel>
    <title>schweda.net - Blog</title>
    <link>https://www.schweda.net/</link>
    <description>schweda.net - Blog - Blog-Beitraege</description>
    <language>de-at</language>
    <copyright>Copyright 2006-2026</copyright>
    <generator>schweda.net</generator>
    <managingEditor>heinz.schweda@schweda.net (Heinz Schweda)</managingEditor>
    <webMaster>heinz.schweda@schweda.net (Heinz Schweda)</webMaster>
    <category>Blog</category>
	<atom:link href="https://schweda.net/blog_rss.php?bid=326" rel="self" type="application/rss+xml" />
<item>
<title><![CDATA[Prüfziffernberechnung von EAN-Codes]]></title>
<description><![CDATA[
<p>Nachstehend ein St&uuml;ckchen Code, welcher die Pr&uuml;fziffer f&uuml;r EAN-Codes berechnet.
</p>


<pre class="pre_blog_axcode">
static int getCheckSum(str _ean)
{
    int         i;
    int         v;
    int         s;
    int         q;
    int         r;
    int         m;
    ;

    if( strLen(_ean) != 7  &amp;&amp;   // EAN 8
        strLen(_ean) != 11 &amp;&amp;   // UPC-A
        strLen(_ean) != 12 &amp;&amp;   // EAN 13
        strLen(_ean) != 13 &amp;&amp;   // EAN 14, ITF 14
        strLen(_ean) != 17 )    // SSCC
    {
        throw error(&quot;EAN not valid.&quot;);
    }

    for (i=strLen(_ean); i&gt;0; i--)
    {
        v = str2int(substr(_ean, i, 1));

        m = ( m == 3 ? 1 : 3 );

        v = v * m;

        s += v;
    }

    q = s mod 10;
    if(q == 0)
    {
        r = 0;
    }
    else
    {
        r = 10 - q;
    }

    return r;
}
</pre>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Thu, 06 Aug 2009 17:13:00 +0200</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=326</link>
<comments>https://www.schweda.net/blog_ax.php?bid=326</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=326</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=326</wfw:commentRss>
</item>
</channel>
</rss>	
