?
Solved

Syntax problem with if statement

Posted on 2000-04-21
6
Medium Priority
?
201 Views
Last Modified: 2010-04-04
I have three edit boxes. Edit 1 2 and 3. what I'm trying to achieve is:-

If editbox 2 is equal or greater than Editbox 1 then edit box 3 equals nil. Else, Edit box 3 equals Edit box 1 less Edit Box 2.

What ever I do I can't get the syntax right.

Many thanks

Nick
0
Comment
Question by:NickRackham
[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
  • 4
  • 2
6 Comments
 
LVL 1

Expert Comment

by:tomer_engel
ID: 2738980
if StrToInt(edit2.Text) >= StrToInt(edit1.Text)  then
  edit1.Text :=''
else edit3.text := IntToStr( StrToInt(edit1.Text) - StrToInt(edit2.Text) );

in the case your'e talking about numbers...

bye Tomer

0
 
LVL 1

Expert Comment

by:tomer_engel
ID: 2738982
if StrToInt(edit2.Text) >= StrToInt(edit1.Text)  then
  edit3.Text :=''
else edit3.text := IntToStr( StrToInt(edit1.Text) - StrToInt(edit2.Text) );

in the case your'e talking about numbers...

bye Tomer

0
 
LVL 1

Expert Comment

by:tomer_engel
ID: 2738983
the second one is currect not the first one!!!!
0
Technology Partners: 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!

 
LVL 1

Accepted Solution

by:
tomer_engel earned 200 total points
ID: 2738985
i don't know why but in the then cluase it didn't put the double '('   ' )and switched it with "

so pay attention::::



if StrToInt(edit2.Text) >= StrToInt(edit1.Text)  then
  edit3.Text :=' '  //i mean put nothing in the edit 3 text box
else edit3.text := IntToStr( StrToInt(edit1.Text) - StrToInt(edit2.Text) );  
0
 
LVL 4

Author Comment

by:NickRackham
ID: 2739636
Tomer, Sorry I'd gone to catch up my beauty sleep :o) <grin> I'll try this later and post back later.

Thanks

Nick
0
 
LVL 4

Author Comment

by:NickRackham
ID: 2740645
Tomer, Many thanks - Just what I wanted. Nick
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

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…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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
Course of the Month11 days, 18 hours left to enroll

752 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