jeromerocks Posted October 9, 2008 Posted October 9, 2008 Hi all,I need some help with delphi.I have 3 TLabels and a Tbutton on my application.Tlabel1.Caption := 2;Tlabel2.Caption := 4;When I press the Tbutton, I want it to minus TLabel2.Caption from TLabel1.Caption, and display the output in Tlabel3.TLabel1 and TLabel2 are not constants ie. they are the result of other maths equations.Hope i didn't make it too confusing.Thanks a lot!
DeltaAziz Posted October 9, 2008 Posted October 9, 2008 Hito to minus TLabel2.Caption from TLabel1.Caption double click on Tbutton1 and write:Label3.Caption := FloatToStr( StrToFloat( Label2.Caption ) - StrToFloat( Label1.Caption ) );
jeromerocks Posted October 9, 2008 Author Posted October 9, 2008 I was about to post that I resolved it already.I used that code and saved it into a string variable because i still needed to manipulate the equations.Thanks anyway.
FAT64 Posted October 9, 2008 Posted October 9, 2008 Any reason why you're using Float? Looks to me like he's using Integers.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now