REPORT z_barry_ean13 .
DATA: cc(4) TYPE n .
PARAMETERS ean(13) TYPE n DEFAULT '4891214611016'.
cc = ean+0(1) + ean+2(1) + ean+4(1) + ean+6(1) + ean+8(1) + ean+10(1) +
( ( ean+1(1) + ean+3(1) + ean+5(1) + ean+7(1) + ean+9(1) + ean+11(1) ) * 3 ) .
cc = 10 - cc+3.
WRITE: 'EAN13:',ean .
WRITE: / '检查码:', cc+3.
SKIP.
IF cc+3 = ean+12.
WRITE 'OK'.
ELSE.
WRITE 'Error'.
ENDIF.
阅读(3663) | 评论(0) | 转发(0) |