Function BarkodOlustur1(Bar12Hane:String):String;
Var
tek_toplam,
cift_toplam,
tum_toplam,
i : Integer;
begin
tek_toplam := 0;
cift_toplam := 0;
tum_toplam := 0;
For i := 1 to Length(Bar12Hane) do begin
If i mod 2 <> 0
then tek_toplam := tek_toplam + (StrToInt(Bar12Hane[i])*1)
else cift_toplam := cift_toplam + (StrToInt(Bar12Hane[i])*3);
end;
tum_toplam := 10 - ((tek_toplam+cift_toplam) mod 10);
If tum_toplam = 10 then tum_toplam := 0;
Result := Format('%d', [tum_toplam]);
end;


function BarkodOlustur2():String;
var
s : string;
i : integer;
begin
s:='';
for i:=1 to 12 do
begin
s:=s+inttostr(random(10));
end;
Result := S + BarkodOlustur1(s);
end;


procedure TForm1.BitBtn7Click(Sender: TObject);
begin
Memo1.Text:=BarkodOlustur2;
end;
end.
