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!

add "and" to an "if" statement

Status
Not open for further replies.

evr72

MIS
Dec 8, 2009
265
US
hello,

I have the following code
Code:
if (ctrlkeycontrol.getValue() == 'X')
{ 
ctrlresp.addValidation("IsRequired");

  ctrliscontroldocumented.addValidation("IsRequired"); 
  ctrlnarrativeofcontrol.addValidation("IsRequired"); 
  ctrlfrequency.addValidation("IsRequired"); 
  ctrlpersonresponsable.addValidation("IsRequired"); 
  ctrlmanualorautomated.addValidation("IsRequired"); 
}
else if(ctrlkeycontrol.getValue() == null)
{ ctrlcorrectiveactionplanned.addValidation("IsRequired");
  ctrlplancompletiondate.addValidation("IsRequired");
}

This works well, but I would like to add "and" to my if statement so it would look something like this

Code:
if (ctrlkeycontrol.getValue() == 'X' and ctrlmaincontrol.getVlue() == 'No')

I tried this but does not work any ideas?

thanks!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top