Solved

Very Easy : I just can't think!

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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

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…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
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…

737 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