EAN (Taschenrechner)‎ > ‎Quellcode‎ > ‎

Version 0.5

Stand: 13. Juli 2009
{3211,2221,2122,1411,1132,1231,1114,1312,1213,3112,1123,1222,2212,1141,2311,1321,4111,2131,3121,2113,000000,001001,001101,001110,010011,01101,011100,010101,010110,011010}➙List 6
While 1⤶
ClrText⤶
" "⤶
" "⤶
" "⤶
Locate 1,1,"(1) BARCODE ➙ NUMBER"⤶
Locate 1,2,"(2) NUMBER ➙ BARCODE"⤶
Locate 1,3,"(3) CHECKDIGIT"⤶
?➙A⤶
A=1⥤Goto 1⤶
A=2⥤Goto 2⤶
A=3⥤Goto 3⤶
WhileEnd⤶
Lbl 1⤶
If Dim List 1=8⤶
Then Seq(-1,X,1,8,1)➙List 2⤶
Seq(-1,X,1,8,1)➙List 3⤶
For 1➙I To 8⤶
For 1➙J To 10⤶
If List 1[I]=List 6[J]⤶
Then J-1➙List 2[I]⤶
0➙List 3[I]⤶
IfEnd⤶
If List 1[I]=List 6[J+10]⤶
Then J-1➙List 2[I]⤶
1➙List 3[I]⤶
IfEnd⤶
Next⤶
Next⤶
List 3[1]➙A⤶
For 2➙I To 8⤶
If List 3[I]≠A⤶
Then -1➙A⤶
Break⤶
IfEnd⤶
Next⤶
If A=1⤶
Then ClrText⤶
" "⤶
" "⤶
" "⤶
Locate 3,1,"DIRECTION WILL BE"⤶
Locate 5,2,"CORRECTED..."⤶
" "◢
List 2⤶
For 1➙I To 8⤶
List Ans[9-I]➙List 2[I]⤶
Next⤶
List 3⤶
Seq(0,X,1,8,1)➙List 3⤶
Else If A=-1⤶
Then ClrText⤶
" "⤶
" "⤶
" "⤶
Locate 2,1,"DIRECTION COULD NOT"⤶
Locate 5,2,"BE DETECTED!"⤶
" "◢
IfEnd⤶
IfEnd⤶
List➙Mat(2,3)◢
Else If Dim List 1=12⤶
Then Seq(-1,X,1,13,1)➙List 2⤶
Seq(-1,X,1,13,1)➙List 3⤶
For 1➙I To 12⤶
For 1➙J To 10⤶
If List 1[I]=List 6[J]⤶
Then J-1➙List 2[I+1]⤶
0➙List 3[I+1]⤶
IfEnd⤶
If List 1[I]=List 6[J+10]⤶
Then J-1➙List 2[I+1]⤶
1➙List[I+1]⤶
IfEnd⤶
Next⤶
Next⤶
0➙A⤶
For 8➙I To 13⤶
If List 3[I]≠A⤶
Then -1➙A⤶
Break⤶
IfEnd⤶
Next⤶
If A≠0⤶
Then 1➙A⤶
For 2➙I To 7⤶
If List 3[I]≠A⤶
Then -1➙A⤶
Break⤶
IfEnd⤶
Next⤶
If A=1⤶
Then ClrText⤶
" "⤶
" "⤶
" "⤶
Locate 3,1,"DIRECTION WILL BE"⤶
Locate 5,2,"CORRECTED..."⤶
" "(DREICECK)⤶
List 2⤶
For 2➙I to 13⤶
List Ans[15-I]➙List 2[I]⤶
Next⤶
List 3⤶
For 2➙I To 13⤶
List Ans[15-I]=0➙List 3[I]⤶
Next⤶
Else ClrText⤶
" "⤶
" "⤶
" "⤶
Locate 2,1,"DIRECTION COULD NOT"⤶
Locate 5,2,"BE DETECTED!"⤶
Stop⤶
IfEnd⤶
IfEnd⤶
For 0➙I To 9⤶
List 6[I+21]➙A⤶
For 1➙J To 6⤶
Int (A÷10^(6-J))➙B⤶
A-B✕10^(6-J)➙A⤶
If B≠List 3[J+1]⤶
Then Break⤶
IfEnd⤶
If J=6⤶
Then I➙List 2[1]⤶
9➙I⤶
IfEnd⤶
Next⤶
Next⤶
List➙Mat(2,3)◢
Else ClrText⤶
" "⤶
" "⤶
" "⤶
Locate 2,1,"Dim List 1 MUST BE"⤶
Locate 7,2,"8 OR 12!"⤶
Stop⤶
IfEnd⤶
IfEnd⤶
Stop⤶
Lbl 2⤶
ClrGraph⤶
CoordOff⤶
GridOff⤶
AxesOff⤶
LabelOff⤶
-63.5➙Xmin⤶
63.5➙Xmax⤶
0➙Xscl⤶
13➙Ymax⤶
-7➙Ymin⤶
0➙Yscl⤶
If Dim List 1=8⤶
Then F-Line -33,10,-33,-2⤶
F-Line -31,10,-31,-2⤶
For 1➙I To 4⤶
-30+(7✕(I-1))➙X⤶
List 1[I]+1➙A⤶
List 6[A]➙A⤶
For 1➙J To 4⤶
Int (A÷10^(4-➙J))➙B⤶
A-B✕10^(4-J)➙A⤶
For 1➙K To B⤶
If Frac(J÷2)=0⤶
Then F-Line X,10,X,0⤶
IfEnd⤶
X+1➙X⤶
Next⤶
Next⤶
Next⤶
F-Line -1,10,-1,-2⤶
F-Line 1,10,1,-2⤶
For 1➙I To 4⤶
3+(7✕(I-1))➙X⤶
List 1[I+4]+1➙A⤶
List 6[A]➙A⤶
For 1➙J To 4⤶
Int (A÷10^(4-J))➙B⤶
A-B✕10^(4-J)➙A⤶
For 1➙K To B⤶
If Frac(J÷2)=0.5⤶
Then F-Line X,10,X,0⤶
IfEnd⤶
X+1➙X⤶
Next⤶
Next⤶
Next⤶
F-Line 31,10,31,-2⤶
F-Line 33,10,33,-2⤶
For 1➙I To 4⤶
Text 44,(64-31+(I-1)✕7+3,List 1[I]⤶
Next⤶
For 1➙I To 4⤶
Text 44,64+2+(I-1)✕7+3,List 1[I+4]⤶
Next⤶
Else If Dim List 1=13⤶
Then F-Line -47,10,-47,-2⤶
F-Line -45,10,-45,-2⤶
List 1[1]+21➙A⤶
List 6[A]➙A⤶
6➙Dim List 2⤶
For 1➙I To 6⤶
Int (A÷10^(6-I))➙B⤶
A-B✕10^(6-I)➙A⤶
B➙List 2[I]⤶
Next⤶
For 1➙I To 6⤶
-44+(7✕(I-1))➙x⤶
If List 2[I]=0⤶
Then List 1[I+1]+1➙A⤶
Else List 1[I+1]+11➙A⤶
IfEnd⤶
List 6[A]➙A⤶
For 1➙J To 4⤶
Int (A÷10^(4-J))➙B⤶
A-B✕10^(4-J)➙A⤶
For 1➙K To B⤶
If Frac(J÷2)=0⤶
Then F-Line X,10,X,0⤶
IfEnd⤶
X+1➙X⤶
Next⤶
Next⤶
Next⤶
F-Line -1,10,-1,-2⤶
F-Line 1,10,1,-2⤶
For 1➙I To 6⤶
3+(7✕(I-1))➙X⤶
List 1[I+7]+1➙A⤶
List 6[A]➙A⤶
For 1➙J To 4⤶
Int (A÷10^(4-J))➙B⤶
A-B✕10^(4-J)➙A⤶
For 1➙K To B⤶
If Frac(J÷2)=0.5⤶
Then F-Line X,10,X,0⤶
IfEnd⤶
X+1➙X⤶
Next⤶
Next⤶
Next⤶
F-Line 45,10,45,-2⤶
F-Line 47,10,47,-2⤶
Text 44,11,List 1[1]⤶
For 1➙I To 6⤶
Text 44,(64-45+(I-1)✕7+3,List 1[I+1]⤶
Next⤶
For 1➙I To 6⤶
Text 44,(64+2+(I-1)✕7+3,List 1[I+7]⤶
Next⤶
Else ClrText⤶
" "⤶
" "⤶
" "⤶
Locate 2,1,"Dim List 1 MUST BE"⤶
Locate 7,2,"8 OR 13!"⤶
Stop⤶
IfEnd⤶
IfEnd⤶
Stop⤶
Lbl 3⤶
Dim List 1➙A⤶
A=8⥤7➙A⤶
A=13⥤12➙A⤶
A=7⥤0.5➙B⤶
A=12⥤0➙B⤶
0➙C⤶
If (A=12) Or (A=7)⤶
Then For A➙I To 1 Step -1⤶
If Frac(I÷2)=B⤶
Then List 1[I]✕3+C➙C⤶
Else List 1[I]✕1+C➙C⤶
IfEnd⤶
Next⤶
(Int (C÷10+1)✕10)-C➙C⤶
C=10⥤0➙C⤶
ClrText⤶
" "⤶
" "⤶
" "⤶
Locate 5,1,"CHECKDIGIT: "⤶
Locate 17,1,C⤶
If (Dim List 1=8) Or (Dim List 1=13)⤶
Then Dim List 1=8⥤List 1[8]➙A⤶
Dim List 1=13⥤List 1[13]➙A⤶
If A=C⤶
Then Locate 4,3,"NUMBER CORRECT"⤶
Else Locate 2,3,"NUMBER NOT CORRECT"⤶
IfEnd⤶
IfEnd⤶
Else ClrText⤶
" "⤶
" "⤶
" "⤶
Locate 2,1,"Dim List 1 MUST BE"⤶
Locate 5,2,"7,8,12 OR 13"⤶
Stop⤶
IfEnd⤶
Stop