Solved

How to check value between x and y?

Posted on 1998-07-06
5
133 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
  • 3
5 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 20 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now