PF卡号转换:
procedure TForm1.Button2Click(Sender: TObject);
var
a,b,c,d,e,x:string;
Info2:Change;
i:integer;
r1,r2,r3,r4,r5:string;
begin
if length(edit1.Text)=10 then
begin
//x:=length(edit1.text) ;
a:=copy(edit1.Text,9,2);
b:=copy(edit1.Text,7,2);
c:=copy(edit1.Text,5,2);
d:=copy(edit1.Text,3,2);
e:=copy(edit1.Text,1,2);
edit3.text:=e+d+c+b+a;
if edit3.text = edit1.Text then
label3.Caption:='TRUE'
else
begin
label3.Caption:='ERROR';
end;
//////////////////
r1 := info2.HexToDex(a) ;
r2 := info2.HexToDex(b) ;
r3 := info2.HexToDex(c) ;
r4 := info2.HexToDex(d) ;
r5 := info2.HexToDex(e) ;
edit4.Text:=r1+'+'+r2+'×256'+'+'+r3+'×256×256'+'+'+r4+'×256×256×256'+'+'+r5+'×256×256×256×256';
//showmessage( floattostr ( strtofloat(r1)+ strtofloat(r2)*256+strtofloat(r3)*256*256 +strtofloat(r4)*256*256*256 +strtofloat(r5)*256*256*256*256 ) );
x:= floattostr ( strtofloat(r1)+ strtofloat(r2)*256+strtofloat(r3)*256*256 +strtofloat(r4)*256*256*256 +strtofloat(r5)*256*256*256*256 ) ;
for i:=length(x) to 14 do
begin
x:='0'+x;
end;
edit2.text:='8'+x
end
else
begin
showmessage('卡号输入错误,请输入10位卡号!')
end;
end;