注册 登录
编程论坛 C++ Builder

各位帮帮忙!简单的函数内部问题!

Jiaoliu888 发布于 2008-08-26 10:03, 1073 次点击
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  randomize();
  for(int i=0;i<4;i++)
  {
  RandomData[i]=abs(RandomData[i]*random(15))+1;
  if(i==0)
    Image1->Picture->LoadFromFile("d:\My Documents\My Pictures\RandomData[i].jpg")
  else if(i==1)         //提示这里错误
    Image2->Picture->LoadFromFile("d:\My Documents\My Pictures\RandomData[i].jpg")
  else if(i==2)
    Image3->Picture->LoadFromFile("d:\My Documents\My Pictures\RandomData[i].jpg")
  else
    Image4->Picture->LoadFromFile("d:\My Documents\My Pictures\RandomData[i].jpg")
  }
  Edit1->Text="";
  Edit1->SetFocus();
}
2 回复
#2
Jiaoliu8882008-08-26 10:07
请高手帮帮我吧!
#3
xunxunmimi2008-08-26 14:48
语句后面的分号没加上!
Image1->Picture->LoadFromFile("d:\My Documents\My Pictures\RandomData[i].jpg")
1