Link to home
Start Free TrialLog in
Avatar of Guiseppe
Guiseppe

asked on

How to check value between x and y?

I want to check for a certain value, lets say between 40 and 50. In VB I would write something like this:

i = integer

if i < 40 or i > 50 then ...

How can I do this in Delphi?
ASKER CERTIFIED SOLUTION
Avatar of ZifNab
ZifNab

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ZifNab
ZifNab

Sorry, to quick, the total answer ;-) should look like :

Hi Guiseppe,

 var i : integer;

begin
 if (i<40) or (i> 50) then begin
  {write code here}
 end;
end;

need to know more? Just ask!

Zif.
Between?????

May be

if (I>=40) and (I<=50) then

Oops, vladika you're right. If 40 and 50 have to included, you need to use >= and <=.
Avatar of Guiseppe

ASKER

Well, OK. It was just a matter of placing brackets the right way.
Thanks for your help, folks.