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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help for a newbie with operator functions.

Status
Not open for further replies.

Laugher

Technical User
Oct 9, 2002
4
AU
Hi this is a really simple question and I feel a little silly asking it but I can't seem it get it. How would I make this statement work:

($Age >= &quot;18&quot; and < &quot;55&quot;)

Thanks in advance.
 
I believe one way to do it is...

if (($Age >= &quot;18&quot;) AND ($Age < &quot;55&quot;)) {
//do something
}

 
Note that if you're having them as strings, then 12 is less than 2 because it compares each character in turn.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top