?
Solved

String to integer conversion

Posted on 2005-05-11
5
Medium Priority
?
240 Views
Last Modified: 2010-04-05
We are using Delphi2005.net and need to convert a string value to an integer. Any ideas on how please as strtoint etc. does not seem to work

Best regards
0
Comment
Question by:Paul-Brooks
  • 2
  • 2
5 Comments
 
LVL 15

Expert Comment

by:mikelittlewood
ID: 13978747
Well I have noticed now that most of the .net functions happen at the end of string objects such as

sString := Trim(sString)
is now
sString := sString.Trim();

so maybe it is something like
iInt := sString.StrToInt()

Have a look at the methods that get exposed when you do sString.
0
 
LVL 6

Accepted Solution

by:
wimmeyvaert earned 2000 total points
ID: 13978759
Are you sure you have SysUtils in your Uses Clause ?
0
 
LVL 15

Expert Comment

by:mikelittlewood
ID: 13978806
How about
iInt := CInt(sString)
0
 

Author Comment

by:Paul-Brooks
ID: 13978814
That is exactly the problem. Cant see the wood from the tree's im afraid :)
0
 
LVL 6

Expert Comment

by:wimmeyvaert
ID: 13984022
Sometimes the biggest problems have the simplest answers, don't they ? ;-)
0

Featured Post

Technology Partners: 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 The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Loops Section Overview
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

864 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