Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

two conditions in one if ? 1

Status
Not open for further replies.

rzrdigo

Programmer
Jan 7, 2011
19
BR
i wanted to do the following:
"If RadioButton1 AND RadioButton2 ARE NOT checked, send message "Check one", else blabla"
i tried like this:

if((RBtnIsot->Checked==false) ,(RBtnIsoc->Checked==false) )
{
MessageDlg("Choose the simulation.", mtError, TMsgDlgButtons() << mbOK, 0);
}
else
{
...

but it didnt work, any ideas??
 
Code:
f((RBtnIsot->Checked==false) &&(RBtnIsoc->Checked==false) )
{
MessageDlg("Choose the simulation.", mtError, TMsgDlgButtons() << mbOK, 0);
}
else
{
...

In Standard C/C++
|| = OR
&& = AND



James P. Cottingham
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
thanks a lot, that simplifies it a lot.
i was using + as OR and , as AND. And the + is also an OR or not? hehe
 
What's a funny "== false" ;)
Remember C++ boolean NOT operator:
Code:
if (!RBtbIsot->Checked && !RBtnIsoc->Checked)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top