function incChar(c: char): char;
var
c1: char;
begin
result := #32;
if c = '9' then
c1 := a
else if c = 'z' then
c1 := 'Z'
else if (c in ['0'..'8']) or (c in ['a'..'y']) or c in ['A'..'Y'] then
c1 := chr(ord(c) + 1);
result := c1;
end;
一点小问题
function incChar(c: char): char;
var
c1: char;
begin
result := #32;
if c = '9' then
c1 := a
else if c = 'z' then
c1 := 'A'
else if (c in ['0'..'8']) or (c in ['a'..'y']) or c in ['A'..'Y'] then
c1 := chr(ord(c) + 1);
result := c1;
end;
var i,j,r:byte;
begin
i:=ord(Edit3.text[1]); //基数 0-9 a-z ,A-Z
if (i in [ord('0')..ord('9')]) then
begin
i:=i-ord('0');
end;
j:=StrToInt(Edit4.Text); //加数 0-9
r:=i+j;
if (r in[0..9] )then
begin
r:=r+ord('0');
end
else if (r in [10..19] )then
begin
r:=r+ord('a')-10;
end;
Label6.Caption:=chr(r);
end;
var i,j,r:byte;
begin
i:=ord(Edit3.text[1]); //基数 0-9 a-z ,A-Z
if (i in [ord('0')..ord('9')]) then
begin
i:=i-ord('0');
end;
j:=StrToInt(Edit4.Text); //加数0-9
r:=i+j;
if (r in[0..9] )then
begin
r:=r+ord('0');
end
else if (r in [10..19] )then
begin
r:=r+ord('a')-10;
end
else if ((i in [ord('a')..ord('z')] ) and (r>ord('z'))) then
begin
r:=r-ord('z')+ord('A')-1;
end
else if((r>ord('Z')) and (r<ord('a')) ) then
begin
r:=0; //越界
end;
Label6.Caption:=chr(r);