Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Syntax problem with if statement

Posted on 2000-04-21
6
Medium Priority
?
202 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
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!

 
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

Industry Leaders: 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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
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…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

636 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