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?
i = integer
if i < 40 or i > 50 then ...
How can I do this in Delphi?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Between?????
May be
if (I>=40) and (I<=50) then
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 <=.
ASKER
Well, OK. It was just a matter of placing brackets the right way.
Thanks for your help, folks.
Thanks for your help, folks.
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.