送分,简单问题,只有十行代码
procedure TForm1.Button1Click(Sender: TObject);
var
lun: string;
i: integer;
begin
lun := 'YDMNY';
for i := 1 to 5 do
begin
if copy(lun, i, 1) = 'Y' then
labeli.caption := '花生'
if copy(lun, i, 1) = 'N' then
labeli.caption := '无'
if copy(lun, i, 1) = 'M' then
labeli.caption := '小麦'
if copy(lun, i, 1) = 'D' then
labeli.caption := '水稻';
end;
end;
我知道是labeli这里出错,怎么改,附上代码者有分。