Solved

Syntax problem with if statement

Posted on 2000-04-21
6
197 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
  • 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

 
LVL 1

Accepted Solution

by:
tomer_engel earned 50 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

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…
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

837 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