language: Pascal (fpc) (fpc 2.2.0)
date: 105 days 6 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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.
 
Free Pascal Compiler version 2.2.0 [2009/11/16] for i386
Copyright (c) 1993-2007 by Florian Klaempfl
Target OS: Linux for i386
Compiling prog.pas
prog.pas(13,42) Error: Identifier not found "StrToInt"
prog.pas(14,44) Error: Identifier not found "StrToInt"
prog.pas(18,8) Error: Identifier not found "Result"
prog.pas(18,17) Error: Identifier not found "Format"
prog.pas(30,14) Error: Identifier not found "inttostr"
prog.pas(32,8) Error: Identifier not found "Result"
prog.pas(36,18) Error: Identifier not found "TForm1"
prog.pas(36,30) Error: class identifier expected
prog.pas(38,6) Error: Identifier not found "Memo1"
prog.pas(40,1) Fatal: Syntax error, "BEGIN" expected but "END" found
Fatal: Compilation aborted
Error: /usr/bin/ppc386 returned an error exitcode (normal if you did not specify a source file to be compiled)