请看下面这段代码:
procedure TForm1.Button1Click(Sender: TObject);
var
strColor: string;
i, R, G, B, p: integer;
strlist: TStringList;
begin
strColor := medt.Text + '-';
strlist := TStringList.Create;
try
for R := 0 to 2 do //把变量R改为i正常
begin
//showmessage(inttostr(r)); 加上这句也正常了 循环体内读过R 值
p := pos('-', strColor);
strlist.Add(copy(strColor, 0, p-1));
delete(strColor, 1, p);
end;
R := s...[ 查看全文 ]