其实case 就是好多的if...then 你少用点else 就是了 无非是 if 条件1 then 过程1; if 条件2 then 过程2; ....
procedure case(sendstr:string); var sample:array[1..4] of string; i:integer; begin i:=1; sample[1]:='abcd'; sample[2]:='efd'; sample[3]:='mnq'; sample[4]:='xyz'; while (i<=4) and (sample[i]<>sendstr) do i:=i+1; case i of 1: 2: 3: 4: else end; end;
你少用点else 就是了
无非是 if 条件1 then 过程1;
if 条件2 then 过程2;
....
var sample:array[1..4] of string;
i:integer;
begin
i:=1;
sample[1]:='abcd';
sample[2]:='efd';
sample[3]:='mnq';
sample[4]:='xyz';
while (i<=4) and (sample[i]<>sendstr) do
i:=i+1;
case i of
1:
2:
3:
4:
else
end;
end;