Solved

Very Easy : I just can't think!

Posted on 1998-03-23
1
137 Views
Last Modified: 2010-04-06
Hi,
   I'm sure this is dead simple, but I can't work it out at the moment. All I want to do is change the value of Edit1.Text into an integer. Do you use casting? Or is there an easier way of taking numbers from the user?
Cheers, Nik
0
Comment
Question by:NikWhit
[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
 
LVL 4

Accepted Solution

by:
BoRiS earned 10 total points
ID: 1360734
if you are wanting to convert a string as text (e.g. BoRiS) to integer then use

var
  BorryString: string;
  BorryNum: Integer;
begin
  BorryString := Bor.Text; {Edit1}
  BorryNum := StrToIntDef(BorryString, 500);
  Bor2.Text {Edit2}:= IntToStr(BorryNum);
end;

check out StrToIntDef procedure.... (help file)

if it's a number in a string field to Integer then use the StrToInt or IntToStr procedures

Later

BoRiS
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

740 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