• Post Reply Bookmark Topic Watch Topic
  • New Topic

&& Operator in if statement

 
David Mathie
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am trying to perform a validation check. To and from dates for a hotel booking system. If the user enters a date which is before the initial first date a message dialog will popup saying you need to select a date after the initial date. However I am getting the error bad operand types for binary operator &&. First type int. Second type int.

here is my code:



Thanks
 
R. Ramage
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to do them individually:



If statements have to have a boolean or something that can be true or false. Having an int from a selected index on one side of an && or || without comparing it to something won't work. That's why you're getting the error.
 
David Mathie
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot! worked perfectly!!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!