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
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
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
Thanks
Nick
ASKER
Tomer, Many thanks - Just what I wanted. Nick
edit1.Text :=''
else edit3.text := IntToStr( StrToInt(edit1.Text) - StrToInt(edit2.Text) );
in the case your'e talking about numbers...
bye Tomer