Solved

Very Easy : I just can't think!

Posted on 1998-03-23
1
139 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

726 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