俺想问一下,为什么下面的语句有错
2。俺想问一下,为什么下面的语句有错
procedure TForm1.Button1Click(Sender: TObject);
var j:string;
begin
j:='1';
case j of
'1':showmessage('1');
'2':showmessage('2');
end;
end;
---------------------------------------这是错误
[Error] Unit1.pas(30): Ordinal type required
[Error] Unit1.pas(31): Incompatible types: 'Integer' and 'Char'
[Error] Unit1.pas(32): Incompatible types: 'Integer' and 'Char'
---------------------------------------