Link to home
Start Free TrialLog in
Avatar of NickRackham
NickRackham

asked on

Syntax problem with if statement

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
Avatar of tomer_engel
tomer_engel

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

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

the second one is currect not the first one!!!!
ASKER CERTIFIED SOLUTION
Avatar of tomer_engel
tomer_engel

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of NickRackham

ASKER

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

Thanks

Nick
Tomer, Many thanks - Just what I wanted. Nick