Weiß jemand warum der Debugger in diesem Beispiel die Fehlermeldung "Misplaced else" bringt?
{
long double r,d;
const double PI=3.1415926;
if (RadioButton1->Checked == true)
r = StrToFloat (Edit1->Text);
Edit2->Text = FloatToStr (r*2*PI);
if (RadioButton2->Checked == true)
d = StrToFloat (Edit1->Text);
Edit2->Text = FloatToStr (d*d*PI);
else
MessageBox (NULL, "Sie müssen eine Auswahl treffen!", "Warnung", MB_OK);
}
Danke
{
long double r,d;
const double PI=3.1415926;
if (RadioButton1->Checked == true)
r = StrToFloat (Edit1->Text);
Edit2->Text = FloatToStr (r*2*PI);
if (RadioButton2->Checked == true)
d = StrToFloat (Edit1->Text);
Edit2->Text = FloatToStr (d*d*PI);
else
MessageBox (NULL, "Sie müssen eine Auswahl treffen!", "Warnung", MB_OK);
}
Danke