Solved

How to check value between x and y?

Posted on 1998-07-06
5
140 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 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month3 days, 21 hours left to enroll

630 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