Solved

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

Posted on 1997-12-21
1
168 Views
Last Modified: 2010-04-04
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...
0
Comment
Question by:andy7081
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
TechStone earned 50 total points
ID: 1354337
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

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

751 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