Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to check value between x and y?

Posted on 1998-07-06
5
Medium Priority
?
141 Views
Last Modified: 2010-07-27
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?
0
Comment
Question by:Guiseppe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 80 total points
ID: 1357147

 var i : integer;

begin
 if (i<40) or (i> 50) then begin
 end;
end;
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1357148
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.
0
 
LVL 3

Expert Comment

by:vladika
ID: 1357149
Between?????

May be

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

0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1357150
Oops, vladika you're right. If 40 and 50 have to included, you need to use >= and <=.
0
 

Author Comment

by:Guiseppe
ID: 1357151
Well, OK. It was just a matter of placing brackets the right way.
Thanks for your help, folks.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question