Solved

Very Easy : I just can't think!

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

705 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now