How to make a number appear in a label in delphi 3

I have a countdown timer set up but it wont countdown because 10 is not a valid string... how do i set this as integer...
andy7081Asked:
Who is Participating?
 
TechStoneConnect With a Mentor Commented:
I don't completely understand your question.  What I think you mean is you have an integer, and you want it to appear on a form in a label.

To do that, you need to convert the integer to a string.  You need to use the IntToStr function, that converts an integer to a string.  It might look something like this:

Label1.Caption := IntToStr(Count);

Where Count is the name of your count down variable, and label1 is the name of the label you want it to appear in.

To go the other direction, where you want to convert a string to an integer, you would use the StrToInt function.  For example, if you had an edit box and wanted to get  the starting number for your countdown from that, you would use a statement like:

StartNum := StrToInt(Edit1.Text);

Hope that helps...
0
All Courses

From novice to tech pro — start learning today.