Ok, its fairly simple: Condition 1 + Condition 2 = add the lines "hello world" in richedit. But its not working
(i have 4 conditions in one button click)
Should sound simple but its giving me headackes for example. (wonder what im doing wrong here)
Code:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
if(CheckBox1->Checked==true & CheckBox2->Checked==true);
{
RichEdit1->Lines->Add("hello world");
}
if(CheckBox3->Checked==false & CheckBox4->Checked==false);
{
RichEdit1->Lines->Add("goodbye world");
}
}
Gives hello world
goodbye world
on the same buttonclick , it totally disregards that its supposed to be bounded to the if statement and the given conditions,
Clicking on the button should give only: Hello World or Goodbye world not both
what gives? I mean i used checkboxes, and they seemed to work perfectly fine when the conditions where given, when you use it for adding lines in richedit the whole thing goes haywire making me wonder what im doing wrong?
The thing should only add lines when conditions are being met, why isn't it doing so?